namespace java org.apache.hadoop.hive.ql.plan.api namespace cpp Hive enum AdjacencyType { CONJUNCTIVE, DISJUNCTIVE } struct Adjacency { 1: string node, 2: list children, 3: AdjacencyType adjacencyType, } enum NodeType { OPERATOR, STAGE } struct Graph { 1: NodeType nodeType, 2: list roots, 3: list adjacencyList, } #Represents a operator along with its counters enum OperatorType { JOIN, MAPJOIN, EXTRACT, FILTER, FORWARD, GROUPBY, LIMIT, SCRIPT, SELECT, TABLESCAN, FILESINK, REDUCESINK, UNION, UDTF, LATERALVIEWJOIN, LATERALVIEWFORWARD } struct Operator { 1: string operatorId, 2: OperatorType operatorType, 3: map operatorAttributes, 4: map operatorCounters, 5: bool done, 6: bool started, } # Represents whether it is a map-reduce job or not. In future, different tasks can add their dependencies # The operator graph shows the operator tree enum TaskType { MAP, REDUCE, OTHER } struct Task { 1: string taskId, 2: TaskType taskType 3: map taskAttributes, 4: map taskCounters, 5: optional Graph operatorGraph, 6: optional list operatorList, 7: bool done, 8: bool started, } # Represents a Stage - unfortunately, it is represented as Task in ql/exec enum StageType { CONDITIONAL, COPY, DDL, MAPRED, EXPLAIN, FETCH, FUNC, MAPREDLOCAL, MOVE } struct Stage { 1: string stageId, 2: StageType stageType, 3: map stageAttributes, 4: map stageCounters, 5: list taskList, 6: bool done, 7: bool started, } # Represents a query - # The graph maintains the stage dependency.In case of conditional tasks, it is represented as if only # one of the dependencies need to be executed struct Query { 1: string queryId, 2: string queryType, 3: map queryAttributes, 4: map queryCounters, 5: Graph stageGraph, 6: list stageList, 7: bool done, 8: bool started, } # List of all queries - each query maintains if it is done or started # This can be used to track all the queries in the session struct QueryPlan { 1: list queries, 2: bool done, 3: bool started, }