PREHOOK: query: -- HIVE-3849 Aliased column in where clause for multi-groupby single reducer cannot be resolved create table e1 (key string, count int) PREHOOK: type: CREATETABLE POSTHOOK: query: -- HIVE-3849 Aliased column in where clause for multi-groupby single reducer cannot be resolved create table e1 (key string, count int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@e1 PREHOOK: query: create table e2 (key string, count int) PREHOOK: type: CREATETABLE POSTHOOK: query: create table e2 (key string, count int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@e2 PREHOOK: query: explain from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key PREHOOK: type: QUERY POSTHOOK: query: explain from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e1))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (AND (TOK_FUNCTION in (. (TOK_TABLE_OR_COL src) value) 'val_100' 'val_200' 'val_300') (TOK_FUNCTION in (TOK_TABLE_OR_COL key) 100 150 200))) (TOK_GROUPBY (TOK_TABLE_OR_COL key))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e2))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (AND (TOK_FUNCTION in (. (TOK_TABLE_OR_COL src) value) 'val_400' 'val_500') (TOK_FUNCTION in (TOK_TABLE_OR_COL key) 400 450))) (TOK_GROUPBY (TOK_TABLE_OR_COL key)))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-0 depends on stages: Stage-2 Stage-3 depends on stages: Stage-0 Stage-1 depends on stages: Stage-2 Stage-4 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: src TableScan alias: src Filter Operator predicate: expr: (((value) IN ('val_100', 'val_200', 'val_300') and (key) IN (100, 150, 200)) or ((value) IN ('val_400', 'val_500') and (key) IN (400, 450))) type: boolean Select Operator expressions: expr: key type: string expr: value type: string outputColumnNames: key, value Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: -1 value expressions: expr: value type: string Reduce Operator Tree: Forward Filter Operator predicate: expr: ((VALUE._col0) IN ('val_100', 'val_200', 'val_300') and (KEY._col0) IN (100, 150, 200)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 1 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Filter Operator predicate: expr: ((VALUE._col0) IN ('val_400', 'val_500') and (KEY._col0) IN (400, 450)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 2 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-0 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Stage: Stage-3 Stats-Aggr Operator Stage: Stage-1 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-4 Stats-Aggr Operator PREHOOK: query: from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@e1 PREHOOK: Output: default@e2 POSTHOOK: query: from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@e1 POSTHOOK: Output: default@e2 POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] PREHOOK: query: select * from e1 PREHOOK: type: QUERY PREHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: query: select * from e1 POSTHOOK: type: QUERY POSTHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] 100 2 200 2 PREHOOK: query: select * from e2 PREHOOK: type: QUERY PREHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: query: select * from e2 POSTHOOK: type: QUERY POSTHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] 400 1 PREHOOK: query: explain from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value PREHOOK: type: QUERY POSTHOOK: query: explain from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value POSTHOOK: type: QUERY POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e1))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (or (or (= (+ (. (TOK_TABLE_OR_COL src) key) (. (TOK_TABLE_OR_COL src) key)) 200) (= (- (. (TOK_TABLE_OR_COL src) key) 100) 100)) (AND (= (. (TOK_TABLE_OR_COL src) key) 300) (TOK_FUNCTION TOK_ISNOTNULL (TOK_TABLE_OR_COL VALUE))))) (TOK_GROUPBY (TOK_TABLE_OR_COL value))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e2))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (or (= (+ (. (TOK_TABLE_OR_COL src) key) (. (TOK_TABLE_OR_COL src) key)) 400) (AND (= (- (. (TOK_TABLE_OR_COL src) key) 100) 500) (TOK_FUNCTION TOK_ISNOTNULL (TOK_TABLE_OR_COL VALUE))))) (TOK_GROUPBY (TOK_TABLE_OR_COL value)))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-0 depends on stages: Stage-2 Stage-3 depends on stages: Stage-0 Stage-1 depends on stages: Stage-2 Stage-4 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: src TableScan alias: src Filter Operator predicate: expr: (((((key + key) = 200) or ((key - 100) = 100)) or ((key = 300) and value is not null)) or (((key + key) = 400) or (((key - 100) = 500) and value is not null))) type: boolean Select Operator expressions: expr: value type: string expr: key type: string outputColumnNames: value, key Reduce Output Operator key expressions: expr: value type: string sort order: + Map-reduce partition columns: expr: value type: string tag: -1 value expressions: expr: key type: string Reduce Operator Tree: Forward Filter Operator predicate: expr: ((((VALUE._col0 + VALUE._col0) = 200) or ((VALUE._col0 - 100) = 100)) or ((VALUE._col0 = 300) and KEY._col0 is not null)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 1 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Filter Operator predicate: expr: (((VALUE._col0 + VALUE._col0) = 400) or (((VALUE._col0 - 100) = 500) and KEY._col0 is not null)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 2 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-0 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Stage: Stage-3 Stats-Aggr Operator Stage: Stage-1 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-4 Stats-Aggr Operator PREHOOK: query: from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@e1 PREHOOK: Output: default@e2 POSTHOOK: query: from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@e1 POSTHOOK: Output: default@e2 POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: select * from e1 PREHOOK: type: QUERY PREHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: query: select * from e1 POSTHOOK: type: QUERY POSTHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] val_100 2 val_200 2 PREHOOK: query: select * from e2 PREHOOK: type: QUERY PREHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: query: select * from e2 POSTHOOK: type: QUERY POSTHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] val_200 2 PREHOOK: query: explain from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key PREHOOK: type: QUERY POSTHOOK: query: explain from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key POSTHOOK: type: QUERY POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e1))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (AND (TOK_FUNCTION in (. (TOK_TABLE_OR_COL src) value) 'val_100' 'val_200' 'val_300') (TOK_FUNCTION in (TOK_TABLE_OR_COL key) 100 150 200))) (TOK_GROUPBY (TOK_TABLE_OR_COL key))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e2))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (AND (TOK_FUNCTION in (. (TOK_TABLE_OR_COL src) value) 'val_400' 'val_500') (TOK_FUNCTION in (TOK_TABLE_OR_COL key) 400 450))) (TOK_GROUPBY (TOK_TABLE_OR_COL key)))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-0 depends on stages: Stage-2 Stage-3 depends on stages: Stage-0 Stage-1 depends on stages: Stage-2 Stage-4 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: src TableScan alias: src Filter Operator predicate: expr: (((value) IN ('val_100', 'val_200', 'val_300') and (key) IN (100, 150, 200)) or ((value) IN ('val_400', 'val_500') and (key) IN (400, 450))) type: boolean Select Operator expressions: expr: key type: string expr: value type: string outputColumnNames: key, value Reduce Output Operator key expressions: expr: key type: string sort order: + Map-reduce partition columns: expr: key type: string tag: -1 value expressions: expr: value type: string Reduce Operator Tree: Forward Filter Operator predicate: expr: ((VALUE._col0) IN ('val_100', 'val_200', 'val_300') and (KEY._col0) IN (100, 150, 200)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 1 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Filter Operator predicate: expr: ((VALUE._col0) IN ('val_400', 'val_500') and (KEY._col0) IN (400, 450)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 2 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-0 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Stage: Stage-3 Stats-Aggr Operator Stage: Stage-1 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-4 Stats-Aggr Operator PREHOOK: query: from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@e1 PREHOOK: Output: default@e2 POSTHOOK: query: from src insert overwrite table e1 select key, count(*) where src.value in ('val_100', 'val_200', 'val_300') AND key in (100, 150, 200) group by key insert overwrite table e2 select key, count(*) where src.value in ('val_400', 'val_500') AND key in (400, 450) group by key POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@e1 POSTHOOK: Output: default@e2 POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] PREHOOK: query: select * from e1 PREHOOK: type: QUERY PREHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: query: select * from e1 POSTHOOK: type: QUERY POSTHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] 100 2 200 2 PREHOOK: query: select * from e2 PREHOOK: type: QUERY PREHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: query: select * from e2 POSTHOOK: type: QUERY POSTHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] 400 1 PREHOOK: query: explain from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value PREHOOK: type: QUERY POSTHOOK: query: explain from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value POSTHOOK: type: QUERY POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e1))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (or (or (= (+ (. (TOK_TABLE_OR_COL src) key) (. (TOK_TABLE_OR_COL src) key)) 200) (= (- (. (TOK_TABLE_OR_COL src) key) 100) 100)) (AND (= (. (TOK_TABLE_OR_COL src) key) 300) (TOK_FUNCTION TOK_ISNOTNULL (TOK_TABLE_OR_COL VALUE))))) (TOK_GROUPBY (TOK_TABLE_OR_COL value))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e2))) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL value)) (TOK_SELEXPR (TOK_FUNCTIONSTAR count))) (TOK_WHERE (or (= (+ (. (TOK_TABLE_OR_COL src) key) (. (TOK_TABLE_OR_COL src) key)) 400) (AND (= (- (. (TOK_TABLE_OR_COL src) key) 100) 500) (TOK_FUNCTION TOK_ISNOTNULL (TOK_TABLE_OR_COL VALUE))))) (TOK_GROUPBY (TOK_TABLE_OR_COL value)))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-0 depends on stages: Stage-2 Stage-3 depends on stages: Stage-0 Stage-1 depends on stages: Stage-2 Stage-4 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: src TableScan alias: src Filter Operator predicate: expr: (((((key + key) = 200) or ((key - 100) = 100)) or ((key = 300) and value is not null)) or (((key + key) = 400) or (((key - 100) = 500) and value is not null))) type: boolean Select Operator expressions: expr: value type: string expr: key type: string outputColumnNames: value, key Reduce Output Operator key expressions: expr: value type: string sort order: + Map-reduce partition columns: expr: value type: string tag: -1 value expressions: expr: key type: string Reduce Operator Tree: Forward Filter Operator predicate: expr: ((((VALUE._col0 + VALUE._col0) = 200) or ((VALUE._col0 - 100) = 100)) or ((VALUE._col0 = 300) and KEY._col0 is not null)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 1 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Filter Operator predicate: expr: (((VALUE._col0 + VALUE._col0) = 400) or (((VALUE._col0 - 100) = 500) and KEY._col0 is not null)) type: boolean Group By Operator aggregations: expr: count() bucketGroup: false keys: expr: KEY._col0 type: string mode: complete outputColumnNames: _col0, _col1 Select Operator expressions: expr: _col0 type: string expr: UDFToInteger(_col1) type: int outputColumnNames: _col0, _col1 File Output Operator compressed: false GlobalTableId: 2 table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-0 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e1 Stage: Stage-3 Stats-Aggr Operator Stage: Stage-1 Move Operator tables: replace: true table: input format: org.apache.hadoop.mapred.TextInputFormat output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe name: default.e2 Stage: Stage-4 Stats-Aggr Operator PREHOOK: query: from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@e1 PREHOOK: Output: default@e2 POSTHOOK: query: from src insert overwrite table e1 select value, count(*) where src.key + src.key = 200 or src.key - 100 = 100 or src.key = 300 AND VALUE IS NOT NULL group by value insert overwrite table e2 select value, count(*) where src.key + src.key = 400 or src.key - 100 = 500 AND VALUE IS NOT NULL group by value POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@e1 POSTHOOK: Output: default@e2 POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: select * from e1 PREHOOK: type: QUERY PREHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: query: select * from e1 POSTHOOK: type: QUERY POSTHOOK: Input: default@e1 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] val_100 2 val_200 2 PREHOOK: query: select * from e2 PREHOOK: type: QUERY PREHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: query: select * from e2 POSTHOOK: type: QUERY POSTHOOK: Input: default@e2 #### A masked pattern was here #### POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e1.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.count EXPRESSION [(src)src.null, ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:value, type:string, comment:default), ] POSTHOOK: Lineage: e2.key SIMPLE [(src)src.FieldSchema(name:key, type:string, comment:default), ] val_200 2