PREHOOK: query: --HIVE-3699 Multiple insert overwrite into multiple tables query stores same results in all tables create table e1 (count int) PREHOOK: type: CREATETABLE POSTHOOK: query: --HIVE-3699 Multiple insert overwrite into multiple tables query stores same results in all tables create table e1 (count int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@e1 PREHOOK: query: create table e2 (percentile double) PREHOOK: type: CREATETABLE POSTHOOK: query: create table e2 (percentile double) POSTHOOK: type: CREATETABLE POSTHOOK: Output: default@e2 PREHOOK: query: explain FROM (select key, cast(key as double) as value from src order by key) a INSERT OVERWRITE TABLE e1 SELECT COUNT(*) INSERT OVERWRITE TABLE e2 SELECT percentile_approx(value, 0.5) PREHOOK: type: QUERY POSTHOOK: query: explain FROM (select key, cast(key as double) as value from src order by key) a INSERT OVERWRITE TABLE e1 SELECT COUNT(*) INSERT OVERWRITE TABLE e2 SELECT percentile_approx(value, 0.5) POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: (TOK_QUERY (TOK_FROM (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_TABLE_OR_COL key)) (TOK_SELEXPR (TOK_FUNCTION TOK_DOUBLE (TOK_TABLE_OR_COL key)) value)) (TOK_ORDERBY (TOK_TABSORTCOLNAMEASC (TOK_TABLE_OR_COL key))))) a)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e1))) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTIONSTAR COUNT)))) (TOK_INSERT (TOK_DESTINATION (TOK_TAB (TOK_TABNAME e2))) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION percentile_approx (TOK_TABLE_OR_COL value) 0.5))))) STAGE DEPENDENCIES: Stage-2 is a root stage Stage-3 depends on stages: Stage-2 Stage-0 depends on stages: Stage-3 Stage-4 depends on stages: Stage-0 Stage-1 depends on stages: Stage-3 Stage-5 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-2 Map Reduce Alias -> Map Operator Tree: a:src TableScan alias: src Select Operator expressions: expr: key type: string expr: UDFToDouble(key) type: double outputColumnNames: _col0, _col1 Reduce Output Operator key expressions: expr: _col0 type: string sort order: + tag: -1 value expressions: expr: _col0 type: string expr: _col1 type: double Reduce Operator Tree: Extract Select Operator expressions: expr: _col1 type: double outputColumnNames: _col1 File Output Operator compressed: false GlobalTableId: 0 table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat Stage: Stage-3 Map Reduce Alias -> Map Operator Tree: #### A masked pattern was here #### Reduce Output Operator sort order: tag: -1 value expressions: expr: _col1 type: double expr: 0.5 type: double Reduce Operator Tree: Forward Group By Operator aggregations: expr: count() bucketGroup: false mode: complete outputColumnNames: _col0 Select Operator expressions: expr: UDFToInteger(_col0) type: int outputColumnNames: _col0 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 Group By Operator aggregations: expr: percentile_approx(VALUE._col0, 0.5) bucketGroup: false mode: complete outputColumnNames: _col0 Select Operator expressions: expr: _col0 type: double outputColumnNames: _col0 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-4 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-5 Stats-Aggr Operator PREHOOK: query: FROM (select key, cast(key as double) as value from src order by key) a INSERT OVERWRITE TABLE e1 SELECT COUNT(*) INSERT OVERWRITE TABLE e2 SELECT percentile_approx(value, 0.5) PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@e1 PREHOOK: Output: default@e2 POSTHOOK: query: FROM (select key, cast(key as double) as value from src order by key) a INSERT OVERWRITE TABLE e1 SELECT COUNT(*) INSERT OVERWRITE TABLE e2 SELECT percentile_approx(value, 0.5) 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: e2.percentile EXPRESSION [(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: e2.percentile EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 500 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: e2.percentile EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), ] 255.5