PREHOOK: query: create table test_union_lateral_view(key int, arr_ele int, value string) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@test_union_lateral_view POSTHOOK: query: create table test_union_lateral_view(key int, arr_ele int, value string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@test_union_lateral_view PREHOOK: query: EXPLAIN INSERT OVERWRITE TABLE test_union_lateral_view SELECT b.key, d.arr_ele, d.value FROM ( SELECT c.arr_ele as arr_ele, a.key as key, a.value as value FROM ( SELECT key, value, array(1,2,3) as arr FROM src UNION ALL SELECT key, value, array(1,2,3) as arr FROM srcpart WHERE ds = '2008-04-08' and hr='12' ) a LATERAL VIEW EXPLODE(arr) c AS arr_ele ) d LEFT OUTER JOIN src b ON d.key = b.key PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN INSERT OVERWRITE TABLE test_union_lateral_view SELECT b.key, d.arr_ele, d.value FROM ( SELECT c.arr_ele as arr_ele, a.key as key, a.value as value FROM ( SELECT key, value, array(1,2,3) as arr FROM src UNION ALL SELECT key, value, array(1,2,3) as arr FROM srcpart WHERE ds = '2008-04-08' and hr='12' ) a LATERAL VIEW EXPLODE(arr) c AS arr_ele ) d LEFT OUTER JOIN src b ON d.key = b.key POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 depends on stages: Stage-1 Stage-2 depends on stages: Stage-0 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: src Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string), value (type: string), array(1,2,3) (type: array) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Union Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col3 (type: int), _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE value expressions: _col0 (type: int), _col2 (type: string) Select Operator expressions: _col2 (type: array) outputColumnNames: _col0 Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE function name: explode Lateral View Join Operator outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col3 (type: int), _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE value expressions: _col0 (type: int), _col2 (type: string) TableScan alias: srcpart Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string), value (type: string), array(1,2,3) (type: array) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Union Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col3 (type: int), _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE value expressions: _col0 (type: int), _col2 (type: string) Select Operator expressions: _col2 (type: array) outputColumnNames: _col0 Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 1000 Data size: 10624 Basic stats: COMPLETE Column stats: NONE function name: explode Lateral View Join Operator outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col3 (type: int), _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 2000 Data size: 21248 Basic stats: COMPLETE Column stats: NONE value expressions: _col0 (type: int), _col2 (type: string) TableScan alias: b Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 500 Data size: 5312 Basic stats: COMPLETE Column stats: NONE Reduce Operator Tree: Join Operator condition map: Left Outer Join0 to 1 keys: 0 _col1 (type: string) 1 key (type: string) outputColumnNames: _col0, _col2, _col3 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: UDFToInteger(_col3) (type: int), _col0 (type: int), _col2 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 2200 Data size: 23372 Basic stats: COMPLETE Column stats: NONE 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.test_union_lateral_view 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.test_union_lateral_view Stage: Stage-2 Stats-Aggr Operator PREHOOK: query: INSERT OVERWRITE TABLE test_union_lateral_view SELECT b.key, d.arr_ele, d.value FROM ( SELECT c.arr_ele as arr_ele, a.key as key, a.value as value FROM ( SELECT key, value, array(1,2,3) as arr FROM src UNION ALL SELECT key, value, array(1,2,3) as arr FROM srcpart WHERE ds = '2008-04-08' and hr='12' ) a LATERAL VIEW EXPLODE(arr) c AS arr_ele ) d LEFT OUTER JOIN src b ON d.key = b.key PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Input: default@srcpart PREHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 PREHOOK: Output: default@test_union_lateral_view POSTHOOK: query: INSERT OVERWRITE TABLE test_union_lateral_view SELECT b.key, d.arr_ele, d.value FROM ( SELECT c.arr_ele as arr_ele, a.key as key, a.value as value FROM ( SELECT key, value, array(1,2,3) as arr FROM src UNION ALL SELECT key, value, array(1,2,3) as arr FROM srcpart WHERE ds = '2008-04-08' and hr='12' ) a LATERAL VIEW EXPLODE(arr) c AS arr_ele ) d LEFT OUTER JOIN src b ON d.key = b.key POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Input: default@srcpart POSTHOOK: Input: default@srcpart@ds=2008-04-08/hr=12 POSTHOOK: Output: default@test_union_lateral_view POSTHOOK: Lineage: test_union_lateral_view.arr_ele EXPRESSION [] POSTHOOK: Lineage: test_union_lateral_view.key EXPRESSION [(src)b.FieldSchema(name:key, type:string, comment:default), ] POSTHOOK: Lineage: test_union_lateral_view.value EXPRESSION [(src)src.FieldSchema(name:key, type:string, comment:default), (srcpart)srcpart.FieldSchema(name:key, type:string, comment:default), ] PREHOOK: query: select key, arr_ele, value from test_union_lateral_view order by key, arr_ele limit 20 PREHOOK: type: QUERY PREHOOK: Input: default@test_union_lateral_view #### A masked pattern was here #### POSTHOOK: query: select key, arr_ele, value from test_union_lateral_view order by key, arr_ele limit 20 POSTHOOK: type: QUERY POSTHOOK: Input: default@test_union_lateral_view #### A masked pattern was here #### 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 1 val_0 0 2 val_0 0 2 val_0