PREHOOK: query: create table json_t (key string, jstring string) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@json_t POSTHOOK: query: create table json_t (key string, jstring string) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@json_t PREHOOK: query: insert overwrite table json_t select * from ( select '1', '{"f1": "value1", "f2": "value2", "f3": 3, "f5": 5.23}' from src tablesample (1 rows) union all select '2', '{"f1": "value12", "f3": "value3", "f2": 2, "f4": 4.01}' from src tablesample (1 rows) union all select '3', '{"f1": "value13", "f4": "value44", "f3": "value33", "f2": 2, "f5": 5.01}' from src tablesample (1 rows) union all select '4', cast(null as string) from src tablesample (1 rows) union all select '5', '{"f1": "", "f5": null}' from src tablesample (1 rows) union all select '6', '[invalid JSON string]' from src tablesample (1 rows) ) s PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@json_t POSTHOOK: query: insert overwrite table json_t select * from ( select '1', '{"f1": "value1", "f2": "value2", "f3": 3, "f5": 5.23}' from src tablesample (1 rows) union all select '2', '{"f1": "value12", "f3": "value3", "f2": 2, "f4": 4.01}' from src tablesample (1 rows) union all select '3', '{"f1": "value13", "f4": "value44", "f3": "value33", "f2": 2, "f5": 5.01}' from src tablesample (1 rows) union all select '4', cast(null as string) from src tablesample (1 rows) union all select '5', '{"f1": "", "f5": null}' from src tablesample (1 rows) union all select '6', '[invalid JSON string]' from src tablesample (1 rows) ) s POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@json_t POSTHOOK: Lineage: json_t.jstring EXPRESSION [] POSTHOOK: Lineage: json_t.key EXPRESSION [] PREHOOK: query: explain select a.key, b.* from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key PREHOOK: type: QUERY POSTHOOK: query: explain select a.key, b.* from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: a Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string) outputColumnNames: key Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col0, _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: string) Select Operator expressions: jstring (type: string), 'f1' (type: string), 'f2' (type: string), 'f3' (type: string), 'f4' (type: string), 'f5' (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE function name: json_tuple Lateral View Join Operator outputColumnNames: _col0, _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col5 (type: string), _col6 (type: string), _col7 (type: string), _col8 (type: string), _col9 (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: string), _col2 (type: string), _col3 (type: string), _col4 (type: string), _col5 (type: string) Reduce Operator Tree: Select Operator expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string), VALUE._col1 (type: string), VALUE._col2 (type: string), VALUE._col3 (type: string), VALUE._col4 (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 12 Data size: 472 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 Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink PREHOOK: query: select a.key, b.* from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key PREHOOK: type: QUERY PREHOOK: Input: default@json_t #### A masked pattern was here #### POSTHOOK: query: select a.key, b.* from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key POSTHOOK: type: QUERY POSTHOOK: Input: default@json_t #### A masked pattern was here #### 1 value1 value2 3 NULL 5.23 2 value12 2 value3 4.01 NULL 3 value13 2 value33 value44 5.01 4 NULL NULL NULL NULL NULL 5 NULL NULL NULL NULL 6 NULL NULL NULL NULL NULL PREHOOK: query: explain select json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') as (f1, f2, f3, f4, f5) from json_t a order by f1, f2, f3 PREHOOK: type: QUERY POSTHOOK: query: explain select json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') as (f1, f2, f3, f4, f5) from json_t a order by f1, f2, f3 POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: a Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: jstring (type: string), 'f1' (type: string), 'f2' (type: string), 'f3' (type: string), 'f4' (type: string), 'f5' (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE function name: json_tuple Reduce Output Operator key expressions: c0 (type: string), c1 (type: string), c2 (type: string) sort order: +++ Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE value expressions: c3 (type: string), c4 (type: string) Reduce Operator Tree: Select Operator expressions: KEY.reducesinkkey0 (type: string), KEY.reducesinkkey1 (type: string), KEY.reducesinkkey2 (type: string), VALUE._col0 (type: string), VALUE._col1 (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4 Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 6 Data size: 236 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 Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink PREHOOK: query: select json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') as (f1, f2, f3, f4, f5) from json_t a order by f1, f2, f3 PREHOOK: type: QUERY PREHOOK: Input: default@json_t #### A masked pattern was here #### POSTHOOK: query: select json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') as (f1, f2, f3, f4, f5) from json_t a order by f1, f2, f3 POSTHOOK: type: QUERY POSTHOOK: Input: default@json_t #### A masked pattern was here #### NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL value1 value2 3 NULL 5.23 value12 2 value3 4.01 NULL value13 2 value33 value44 5.01 PREHOOK: query: explain select a.key, b.f2, b.f5 from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key PREHOOK: type: QUERY POSTHOOK: query: explain select a.key, b.f2, b.f5 from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-0 depends on stages: Stage-1 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: a Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: key (type: string) outputColumnNames: key Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col0, _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col6 (type: string), _col9 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: string), _col2 (type: string) Select Operator expressions: jstring (type: string), 'f1' (type: string), 'f2' (type: string), 'f3' (type: string), 'f4' (type: string), 'f5' (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE function name: json_tuple Lateral View Join Operator outputColumnNames: _col0, _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col0 (type: string), _col6 (type: string), _col9 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: string), _col2 (type: string) Reduce Operator Tree: Select Operator expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: string), VALUE._col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 12 Data size: 472 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 12 Data size: 472 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 Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink PREHOOK: query: select a.key, b.f2, b.f5 from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key PREHOOK: type: QUERY PREHOOK: Input: default@json_t #### A masked pattern was here #### POSTHOOK: query: select a.key, b.f2, b.f5 from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 order by a.key POSTHOOK: type: QUERY POSTHOOK: Input: default@json_t #### A masked pattern was here #### 1 value2 5.23 2 2 NULL 3 2 5.01 4 NULL NULL 5 NULL NULL 6 NULL NULL PREHOOK: query: explain select f2, count(*) from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 where f1 is not null group by f2 order by f2 PREHOOK: type: QUERY POSTHOOK: query: explain select f2, count(*) from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 where f1 is not null group by f2 order by f2 POSTHOOK: type: QUERY STAGE DEPENDENCIES: Stage-1 is a root stage Stage-2 depends on stages: Stage-1 Stage-0 depends on stages: Stage-2 STAGE PLANS: Stage: Stage-1 Map Reduce Map Operator Tree: TableScan alias: a Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Select Operator Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col6 (type: string) outputColumnNames: _col6 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Group By Operator aggregations: count() keys: _col6 (type: string) mode: hash outputColumnNames: _col0, _col1 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Select Operator expressions: jstring (type: string), 'f1' (type: string), 'f2' (type: string), 'f3' (type: string), 'f4' (type: string), 'f5' (type: string) outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5 Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE UDTF Operator Statistics: Num rows: 6 Data size: 236 Basic stats: COMPLETE Column stats: NONE function name: json_tuple Filter Operator predicate: c0 is not null (type: boolean) Statistics: Num rows: 3 Data size: 118 Basic stats: COMPLETE Column stats: NONE Lateral View Join Operator outputColumnNames: _col5, _col6, _col7, _col8, _col9 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: _col6 (type: string) outputColumnNames: _col6 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Group By Operator aggregations: count() keys: _col6 (type: string) mode: hash outputColumnNames: _col0, _col1 Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 9 Data size: 354 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Reduce Operator Tree: Group By Operator aggregations: count(VALUE._col0) keys: KEY._col0 (type: string) mode: mergepartial outputColumnNames: _col0, _col1 Statistics: Num rows: 4 Data size: 157 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false table: input format: org.apache.hadoop.mapred.SequenceFileInputFormat output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat serde: org.apache.hadoop.hive.serde2.lazybinary.LazyBinarySerDe Stage: Stage-2 Map Reduce Map Operator Tree: TableScan Reduce Output Operator key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 4 Data size: 157 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Reduce Operator Tree: Select Operator expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: bigint) outputColumnNames: _col0, _col1 Statistics: Num rows: 4 Data size: 157 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false Statistics: Num rows: 4 Data size: 157 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 Stage: Stage-0 Fetch Operator limit: -1 Processor Tree: ListSink PREHOOK: query: select f2, count(*) from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 where f1 is not null group by f2 order by f2 PREHOOK: type: QUERY PREHOOK: Input: default@json_t #### A masked pattern was here #### POSTHOOK: query: select f2, count(*) from json_t a lateral view json_tuple(a.jstring, 'f1', 'f2', 'f3', 'f4', 'f5') b as f1, f2, f3, f4, f5 where f1 is not null group by f2 order by f2 POSTHOOK: type: QUERY POSTHOOK: Input: default@json_t #### A masked pattern was here #### NULL 1 2 2 value2 1 PREHOOK: query: -- Verify that json_tuple can handle new lines in JSON values CREATE TABLE dest1(c1 STRING) STORED AS RCFILE PREHOOK: type: CREATETABLE PREHOOK: Output: database:default PREHOOK: Output: default@dest1 POSTHOOK: query: -- Verify that json_tuple can handle new lines in JSON values CREATE TABLE dest1(c1 STRING) STORED AS RCFILE POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default POSTHOOK: Output: default@dest1 PREHOOK: query: INSERT OVERWRITE TABLE dest1 SELECT '{"a":"b\nc"}' FROM src tablesample (1 rows) PREHOOK: type: QUERY PREHOOK: Input: default@src PREHOOK: Output: default@dest1 POSTHOOK: query: INSERT OVERWRITE TABLE dest1 SELECT '{"a":"b\nc"}' FROM src tablesample (1 rows) POSTHOOK: type: QUERY POSTHOOK: Input: default@src POSTHOOK: Output: default@dest1 POSTHOOK: Lineage: dest1.c1 SIMPLE [] PREHOOK: query: SELECT * FROM dest1 PREHOOK: type: QUERY PREHOOK: Input: default@dest1 #### A masked pattern was here #### POSTHOOK: query: SELECT * FROM dest1 POSTHOOK: type: QUERY POSTHOOK: Input: default@dest1 #### A masked pattern was here #### {"a":"b c"} PREHOOK: query: SELECT json FROM dest1 a LATERAL VIEW json_tuple(c1, 'a') b AS json PREHOOK: type: QUERY PREHOOK: Input: default@dest1 #### A masked pattern was here #### POSTHOOK: query: SELECT json FROM dest1 a LATERAL VIEW json_tuple(c1, 'a') b AS json POSTHOOK: type: QUERY POSTHOOK: Input: default@dest1 #### A masked pattern was here #### b c