PREHOOK: query: -- This test is used for testing EXPLAIN LOGICAL command -- Create some views CREATE VIEW V1 AS SELECT key, value from src PREHOOK: type: CREATEVIEW PREHOOK: Input: default@src PREHOOK: Output: database:default PREHOOK: Output: default@V1 POSTHOOK: query: -- This test is used for testing EXPLAIN LOGICAL command -- Create some views CREATE VIEW V1 AS SELECT key, value from src POSTHOOK: type: CREATEVIEW POSTHOOK: Input: default@src POSTHOOK: Output: database:default POSTHOOK: Output: default@V1 PREHOOK: query: CREATE VIEW V2 AS SELECT ds, key, value FROM srcpart WHERE ds IS NOT NULL PREHOOK: type: CREATEVIEW PREHOOK: Input: default@srcpart PREHOOK: Output: database:default PREHOOK: Output: default@V2 POSTHOOK: query: CREATE VIEW V2 AS SELECT ds, key, value FROM srcpart WHERE ds IS NOT NULL POSTHOOK: type: CREATEVIEW POSTHOOK: Input: default@srcpart POSTHOOK: Output: database:default POSTHOOK: Output: default@V2 PREHOOK: query: CREATE VIEW V3 AS SELECT src1.key, src2.value FROM V2 src1 JOIN src src2 ON src1.key = src2.key WHERE src1.ds IS NOT NULL PREHOOK: type: CREATEVIEW PREHOOK: Input: default@src PREHOOK: Input: default@srcpart PREHOOK: Input: default@v2 PREHOOK: Output: database:default PREHOOK: Output: default@V3 POSTHOOK: query: CREATE VIEW V3 AS SELECT src1.key, src2.value FROM V2 src1 JOIN src src2 ON src1.key = src2.key WHERE src1.ds IS NOT NULL POSTHOOK: type: CREATEVIEW POSTHOOK: Input: default@src POSTHOOK: Input: default@srcpart POSTHOOK: Input: default@v2 POSTHOOK: Output: database:default POSTHOOK: Output: default@V3 PREHOOK: query: CREATE VIEW V4 AS SELECT src1.key, src2.value as value1, src3.value as value2 FROM V1 src1 JOIN V2 src2 on src1.key = src2.key JOIN src src3 ON src2.key = src3.key PREHOOK: type: CREATEVIEW PREHOOK: Input: default@src PREHOOK: Input: default@srcpart PREHOOK: Input: default@v1 PREHOOK: Input: default@v2 PREHOOK: Output: database:default PREHOOK: Output: default@V4 POSTHOOK: query: CREATE VIEW V4 AS SELECT src1.key, src2.value as value1, src3.value as value2 FROM V1 src1 JOIN V2 src2 on src1.key = src2.key JOIN src src3 ON src2.key = src3.key POSTHOOK: type: CREATEVIEW POSTHOOK: Input: default@src POSTHOOK: Input: default@srcpart POSTHOOK: Input: default@v1 POSTHOOK: Input: default@v2 POSTHOOK: Output: database:default POSTHOOK: Output: default@V4 PREHOOK: query: -- Simple select queries, union queries and join queries EXPLAIN LOGICAL SELECT key, count(1) FROM srcpart WHERE ds IS NOT NULL GROUP BY key PREHOOK: type: QUERY POSTHOOK: query: -- Simple select queries, union queries and join queries EXPLAIN LOGICAL SELECT key, count(1) FROM srcpart WHERE ds IS NOT NULL GROUP BY key POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME srcpart TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_TABLE_OR_COL key TOK_SELEXPR TOK_FUNCTION count 1 TOK_WHERE TOK_FUNCTION TOK_ISNOTNULL TOK_TABLE_OR_COL ds TOK_GROUPBY TOK_TABLE_OR_COL key LOGICAL PLAN: srcpart TableScan (TS_0) alias: srcpart Statistics: Num rows: 232 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_2) expressions: key (type: string) outputColumnNames: key Statistics: Num rows: 232 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Group By Operator (GBY_3) aggregations: count(1) keys: key (type: string) mode: hash outputColumnNames: _col0, _col1 Statistics: Num rows: 232 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_4) key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 232 Data size: 23248 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Group By Operator (GBY_5) aggregations: count(VALUE._col0) keys: KEY._col0 (type: string) mode: mergepartial outputColumnNames: _col0, _col1 Statistics: Num rows: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_6) expressions: _col0 (type: string), _col1 (type: bigint) outputColumnNames: _col0, _col1 Statistics: Num rows: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_7) compressed: false Statistics: Num rows: 116 Data size: 11624 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 PREHOOK: query: EXPLAIN LOGICAL SELECT key, count(1) FROM (SELECT key, value FROM src) subq1 GROUP BY key PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT key, count(1) FROM (SELECT key, value FROM src) subq1 GROUP BY key 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_TABLE_OR_COL value subq1 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_TABLE_OR_COL key TOK_SELEXPR TOK_FUNCTION count 1 TOK_GROUPBY TOK_TABLE_OR_COL key LOGICAL PLAN: subq1:src TableScan (TS_0) alias: src Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_1) expressions: key (type: string) outputColumnNames: _col0 Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Group By Operator (GBY_3) aggregations: count(1) keys: _col0 (type: string) mode: hash outputColumnNames: _col0, _col1 Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_4) key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Group By Operator (GBY_5) aggregations: count(VALUE._col0) keys: KEY._col0 (type: string) mode: mergepartial outputColumnNames: _col0, _col1 Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_6) expressions: _col0 (type: string), _col1 (type: bigint) outputColumnNames: _col0, _col1 Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_7) compressed: false Statistics: Num rows: 29 Data size: 2906 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 PREHOOK: query: EXPLAIN LOGICAL SELECT * FROM ( SELECT key, value FROM src UNION ALL SELECT key, value FROM srcpart WHERE ds IS NOT NULL ) S1 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT * FROM ( SELECT key, value FROM src UNION ALL SELECT key, value FROM srcpart WHERE ds IS NOT NULL ) S1 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_SUBQUERY TOK_UNION 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_TABLE_OR_COL value TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME srcpart TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_TABLE_OR_COL key TOK_SELEXPR TOK_TABLE_OR_COL value TOK_WHERE TOK_FUNCTION TOK_ISNOTNULL TOK_TABLE_OR_COL ds S1 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: null-subquery1:s1-subquery1:src TableScan (TS_0) alias: src Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_1) expressions: key (type: string), value (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Union (UNION_5) Statistics: Num rows: 145 Data size: 29060 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_6) expressions: _col0 (type: string), _col1 (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 145 Data size: 29060 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_7) compressed: false Statistics: Num rows: 145 Data size: 29060 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 null-subquery2:s1-subquery2:srcpart TableScan (TS_2) alias: srcpart Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_4) expressions: key (type: string), value (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Union (UNION_5) Statistics: Num rows: 145 Data size: 29060 Basic stats: COMPLETE Column stats: NONE PREHOOK: query: EXPLAIN LOGICAL SELECT S1.key, S2.value FROM src S1 JOIN srcpart S2 ON S1.key = S2.key WHERE ds IS NOT NULL PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT S1.key, S2.value FROM src S1 JOIN srcpart S2 ON S1.key = S2.key WHERE ds IS NOT NULL POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_JOIN TOK_TABREF TOK_TABNAME src S1 TOK_TABREF TOK_TABNAME srcpart S2 = . TOK_TABLE_OR_COL S1 key . TOK_TABLE_OR_COL S2 key TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR . TOK_TABLE_OR_COL S1 key TOK_SELEXPR . TOK_TABLE_OR_COL S2 value TOK_WHERE TOK_FUNCTION TOK_ISNOTNULL TOK_TABLE_OR_COL ds LOGICAL PLAN: s1 TableScan (TS_1) alias: s1 Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_11) predicate: key is not null (type: boolean) Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_3) key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Join Operator (JOIN_6) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col0} outputColumnNames: _col0, _col6 Statistics: Num rows: 63 Data size: 12786 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_8) expressions: _col0 (type: string), _col6 (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 63 Data size: 12786 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_9) compressed: false Statistics: Num rows: 63 Data size: 12786 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 s2 TableScan (TS_0) alias: s2 Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_10) predicate: key is not null (type: boolean) Statistics: Num rows: 58 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_5) key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 58 Data size: 11624 Basic stats: COMPLETE Column stats: NONE value expressions: value (type: string) Join Operator (JOIN_6) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col0} outputColumnNames: _col0, _col6 Statistics: Num rows: 63 Data size: 12786 Basic stats: COMPLETE Column stats: NONE PREHOOK: query: -- With views EXPLAIN LOGICAL SELECT * FROM V1 PREHOOK: type: QUERY POSTHOOK: query: -- With views EXPLAIN LOGICAL SELECT * FROM V1 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME V1 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: v1:src TableScan (TS_0) alias: src Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_1) expressions: key (type: string), value (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_3) compressed: false Statistics: Num rows: 29 Data size: 5812 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 PREHOOK: query: EXPLAIN LOGICAL SELECT * FROM V2 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT * FROM V2 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME V2 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: v2:srcpart TableScan (TS_0) alias: srcpart Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_2) expressions: ds (type: string), key (type: string), value (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_4) compressed: false Statistics: Num rows: 116 Data size: 23248 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 PREHOOK: query: EXPLAIN LOGICAL SELECT * FROM V3 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT * FROM V3 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME V3 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: v3:src1:srcpart TableScan (TS_0) alias: srcpart Statistics: Num rows: 232 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_14) predicate: key is not null (type: boolean) Statistics: Num rows: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_2) expressions: key (type: string) outputColumnNames: _col1 Statistics: Num rows: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_5) key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 116 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Join Operator (JOIN_8) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col0} outputColumnNames: _col1, _col4 Statistics: Num rows: 127 Data size: 12786 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_10) expressions: _col1 (type: string), _col4 (type: string) outputColumnNames: _col0, _col1 Statistics: Num rows: 127 Data size: 12786 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_12) compressed: false Statistics: Num rows: 127 Data size: 12786 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 v3:src2 TableScan (TS_3) alias: src2 Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_13) predicate: key is not null (type: boolean) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_7) key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE value expressions: value (type: string) Join Operator (JOIN_8) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col0} outputColumnNames: _col1, _col4 Statistics: Num rows: 127 Data size: 12786 Basic stats: COMPLETE Column stats: NONE PREHOOK: query: EXPLAIN LOGICAL SELECT * FROM V4 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT * FROM V4 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME V4 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: v4:src1:src TableScan (TS_3) alias: src Statistics: Num rows: 58 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_16) predicate: key is not null (type: boolean) Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_4) expressions: key (type: string) outputColumnNames: _col0 Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_7) key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 29 Data size: 2906 Basic stats: COMPLETE Column stats: NONE Join Operator (JOIN_12) condition map: Inner Join 0 to 1 Inner Join 1 to 2 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col1} 2 {VALUE._col0} outputColumnNames: _col0, _col4, _col6 Statistics: Num rows: 127 Data size: 25572 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_13) expressions: _col0 (type: string), _col4 (type: string), _col6 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 127 Data size: 25572 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_15) compressed: false Statistics: Num rows: 127 Data size: 25572 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 v4:src2:srcpart TableScan (TS_0) alias: srcpart Statistics: Num rows: 116 Data size: 23248 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_18) predicate: key is not null (type: boolean) Statistics: Num rows: 58 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_2) expressions: key (type: string), value (type: string) outputColumnNames: _col1, _col2 Statistics: Num rows: 58 Data size: 11624 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_9) key expressions: _col1 (type: string) sort order: + Map-reduce partition columns: _col1 (type: string) Statistics: Num rows: 58 Data size: 11624 Basic stats: COMPLETE Column stats: NONE value expressions: _col2 (type: string) Join Operator (JOIN_12) condition map: Inner Join 0 to 1 Inner Join 1 to 2 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col1} 2 {VALUE._col0} outputColumnNames: _col0, _col4, _col6 Statistics: Num rows: 127 Data size: 25572 Basic stats: COMPLETE Column stats: NONE v4:src3 TableScan (TS_5) alias: src3 Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_17) predicate: key is not null (type: boolean) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_11) key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE value expressions: value (type: string) Join Operator (JOIN_12) condition map: Inner Join 0 to 1 Inner Join 1 to 2 condition expressions: 0 {KEY.reducesinkkey0} 1 {VALUE._col1} 2 {VALUE._col0} outputColumnNames: _col0, _col4, _col6 Statistics: Num rows: 127 Data size: 25572 Basic stats: COMPLETE Column stats: NONE PREHOOK: query: -- The table should show up in the explain logical even if none -- of the partitions are selected. CREATE VIEW V5 as SELECT * FROM srcpart where ds = '10' PREHOOK: type: CREATEVIEW PREHOOK: Input: default@srcpart PREHOOK: Output: database:default PREHOOK: Output: default@V5 POSTHOOK: query: -- The table should show up in the explain logical even if none -- of the partitions are selected. CREATE VIEW V5 as SELECT * FROM srcpart where ds = '10' POSTHOOK: type: CREATEVIEW POSTHOOK: Input: default@srcpart POSTHOOK: Output: database:default POSTHOOK: Output: default@V5 PREHOOK: query: EXPLAIN LOGICAL SELECT * FROM V5 PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT * FROM V5 POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_TABREF TOK_TABNAME V5 TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR TOK_ALLCOLREF LOGICAL PLAN: v5:srcpart TableScan (TS_0) alias: srcpart Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Filter Operator (FIL_5) predicate: (ds = '10') (type: boolean) Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE Select Operator (SEL_2) expressions: key (type: string), value (type: string), '10' (type: string), hr (type: string) outputColumnNames: _col0, _col1, _col2, _col3 Statistics: Num rows: 0 Data size: 0 Basic stats: NONE Column stats: NONE File Output Operator (FS_4) compressed: false Statistics: Num rows: 0 Data size: 0 Basic stats: NONE 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 PREHOOK: query: EXPLAIN LOGICAL SELECT s1.key, s1.cnt, s2.value FROM (SELECT key, count(value) as cnt FROM src GROUP BY key) s1 JOIN src s2 ON (s1.key = s2.key) ORDER BY s1.key PREHOOK: type: QUERY POSTHOOK: query: EXPLAIN LOGICAL SELECT s1.key, s1.cnt, s2.value FROM (SELECT key, count(value) as cnt FROM src GROUP BY key) s1 JOIN src s2 ON (s1.key = s2.key) ORDER BY s1.key POSTHOOK: type: QUERY ABSTRACT SYNTAX TREE: TOK_QUERY TOK_FROM TOK_JOIN 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 count TOK_TABLE_OR_COL value cnt TOK_GROUPBY TOK_TABLE_OR_COL key s1 TOK_TABREF TOK_TABNAME src s2 = . TOK_TABLE_OR_COL s1 key . TOK_TABLE_OR_COL s2 key TOK_INSERT TOK_DESTINATION TOK_DIR TOK_TMP_FILE TOK_SELECT TOK_SELEXPR . TOK_TABLE_OR_COL s1 key TOK_SELEXPR . TOK_TABLE_OR_COL s1 cnt TOK_SELEXPR . TOK_TABLE_OR_COL s2 value TOK_ORDERBY TOK_TABSORTCOLNAMEASC . TOK_TABLE_OR_COL s1 key LOGICAL PLAN: s1:src TableScan (TS_0) alias: src Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_17) predicate: key is not null (type: boolean) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_1) expressions: key (type: string), value (type: string) outputColumnNames: key, value Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Group By Operator (GBY_2) aggregations: count(value) keys: key (type: string) mode: hash outputColumnNames: _col0, _col1 Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_3) key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Group By Operator (GBY_4) aggregations: count(VALUE._col0) keys: KEY._col0 (type: string) mode: mergepartial outputColumnNames: _col0, _col1 Statistics: Num rows: 7 Data size: 1402 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_5) expressions: _col0 (type: string), _col1 (type: bigint) outputColumnNames: _col0, _col1 Statistics: Num rows: 7 Data size: 1402 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_8) key expressions: _col0 (type: string) sort order: + Map-reduce partition columns: _col0 (type: string) Statistics: Num rows: 7 Data size: 1402 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint) Join Operator (JOIN_11) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} {VALUE._col0} 1 {VALUE._col0} outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE Select Operator (SEL_12) expressions: _col0 (type: string), _col1 (type: bigint), _col3 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_13) key expressions: _col0 (type: string) sort order: + Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE value expressions: _col1 (type: bigint), _col2 (type: string) Select Operator (SEL_14) expressions: KEY.reducesinkkey0 (type: string), VALUE._col0 (type: bigint), VALUE._col1 (type: string) outputColumnNames: _col0, _col1, _col2 Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE File Output Operator (FS_15) compressed: false Statistics: Num rows: 16 Data size: 3306 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 s2 TableScan (TS_6) alias: s2 Statistics: Num rows: 29 Data size: 5812 Basic stats: COMPLETE Column stats: NONE Filter Operator (FIL_16) predicate: key is not null (type: boolean) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE Reduce Output Operator (RS_10) key expressions: key (type: string) sort order: + Map-reduce partition columns: key (type: string) Statistics: Num rows: 15 Data size: 3006 Basic stats: COMPLETE Column stats: NONE value expressions: value (type: string) Join Operator (JOIN_11) condition map: Inner Join 0 to 1 condition expressions: 0 {KEY.reducesinkkey0} {VALUE._col0} 1 {VALUE._col0} outputColumnNames: _col0, _col1, _col3 Statistics: Num rows: 16 Data size: 3306 Basic stats: COMPLETE Column stats: NONE