diff --git ql/src/test/queries/clientpositive/vector_nullsafe_join.q ql/src/test/queries/clientpositive/vector_nullsafe_join.q index 316b2a6..271e207 100644 --- ql/src/test/queries/clientpositive/vector_nullsafe_join.q +++ ql/src/test/queries/clientpositive/vector_nullsafe_join.q @@ -8,10 +8,6 @@ SET hive.auto.convert.join=true; -- results are the same (HIVE-10628 shows native will produce the wrong results -- otherwise). -- --- This query for "HIVE-3315 join predicate transitive" triggers HIVE-10640- --- explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- CREATE TABLE myinput1_txt(key int, value int); LOAD DATA LOCAL INPATH '../../data/files/in8.txt' INTO TABLE myinput1_txt; CREATE TABLE myinput1 STORED AS ORC AS SELECT * FROM myinput1_txt; @@ -43,6 +39,10 @@ SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key<=>b.value; SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a JOIN myinput1 b ON a.key<=>b.value; SELECT /*+ MAPJOIN(b) */ * FROM myinput1 a JOIN myinput1 b ON a.key<=>b.value; +-- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; +select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; + SET hive.vectorized.execution.mapjoin.native.enabled=true; -- merging @@ -70,3 +70,6 @@ SELECT * FROM myinput1 a FULL OUTER JOIN myinput1 b ON a.key<=>b.value; SELECT /*+ MAPJOIN(a) */ * FROM myinput1 a JOIN myinput1 b ON a.key<=>b.value; SELECT /*+ MAPJOIN(b) */ * FROM myinput1 a JOIN myinput1 b ON a.key<=>b.value; +-- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; +select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; diff --git ql/src/test/results/clientpositive/tez/vector_nullsafe_join.q.out ql/src/test/results/clientpositive/tez/vector_nullsafe_join.q.out index db170a9..798ea64 100644 --- ql/src/test/results/clientpositive/tez/vector_nullsafe_join.q.out +++ ql/src/test/results/clientpositive/tez/vector_nullsafe_join.q.out @@ -5,10 +5,6 @@ PREHOOK: query: -- SORT_QUERY_RESULTS -- results are the same (HIVE-10628 shows native will produce the wrong results -- otherwise). -- --- This query for "HIVE-3315 join predicate transitive" triggers HIVE-10640- --- explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- CREATE TABLE myinput1_txt(key int, value int) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default @@ -20,10 +16,6 @@ POSTHOOK: query: -- SORT_QUERY_RESULTS -- results are the same (HIVE-10628 shows native will produce the wrong results -- otherwise). -- --- This query for "HIVE-3315 join predicate transitive" triggers HIVE-10640- --- explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- CREATE TABLE myinput1_txt(key int, value int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default @@ -627,6 +619,94 @@ NULL 35 NULL NULL NULL NULL 10 NULL NULL NULL 48 NULL NULL NULL NULL NULL +PREHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +POSTHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Map 1 <- Map 2 (BROADCAST_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: a + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: key is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 null (type: int) + 1 null (type: int) + nullSafes: [true] + outputColumnNames: _col1, _col5 + input vertices: + 1 Map 2 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + HybridGraceHashJoin: true + Select Operator + expressions: null (type: int), _col1 (type: int), _col5 (type: int), null (type: int) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 3 Data size: 13 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 + Execution mode: vectorized + Map 2 + Map Operator Tree: + TableScan + alias: b + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: value is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: null (type: int) + sort order: + + Map-reduce partition columns: null (type: int) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + value expressions: key (type: int) + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +PREHOOK: Input: default@myinput1 +#### A masked pattern was here #### +POSTHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +POSTHOOK: Input: default@myinput1 +#### A masked pattern was here #### +NULL 10 10 NULL +NULL 10 48 NULL +NULL 10 NULL NULL +NULL 35 10 NULL +NULL 35 48 NULL +NULL 35 NULL NULL +NULL NULL 10 NULL +NULL NULL 48 NULL +NULL NULL NULL NULL PREHOOK: query: -- merging explain select * from myinput1 a join myinput1 b on a.key<=>b.value PREHOOK: type: QUERY @@ -1208,3 +1288,91 @@ NULL 35 NULL NULL NULL NULL 10 NULL NULL NULL 48 NULL NULL NULL NULL NULL +PREHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +POSTHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-1 is a root stage + Stage-0 depends on stages: Stage-1 + +STAGE PLANS: + Stage: Stage-1 + Tez + Edges: + Map 1 <- Map 2 (BROADCAST_EDGE) +#### A masked pattern was here #### + Vertices: + Map 1 + Map Operator Tree: + TableScan + alias: a + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: key is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 null (type: int) + 1 null (type: int) + nullSafes: [true] + outputColumnNames: _col1, _col5 + input vertices: + 1 Map 2 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + HybridGraceHashJoin: true + Select Operator + expressions: null (type: int), _col1 (type: int), _col5 (type: int), null (type: int) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 3 Data size: 13 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 + Execution mode: vectorized + Map 2 + Map Operator Tree: + TableScan + alias: b + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: value is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Reduce Output Operator + key expressions: null (type: int) + sort order: + + Map-reduce partition columns: null (type: int) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + value expressions: key (type: int) + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +PREHOOK: Input: default@myinput1 +#### A masked pattern was here #### +POSTHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +POSTHOOK: Input: default@myinput1 +#### A masked pattern was here #### +NULL 10 10 NULL +NULL 10 48 NULL +NULL 10 NULL NULL +NULL 35 10 NULL +NULL 35 48 NULL +NULL 35 NULL NULL +NULL NULL 10 NULL +NULL NULL 48 NULL +NULL NULL NULL NULL diff --git ql/src/test/results/clientpositive/vector_nullsafe_join.q.out ql/src/test/results/clientpositive/vector_nullsafe_join.q.out index afebc52..ab5162d 100644 --- ql/src/test/results/clientpositive/vector_nullsafe_join.q.out +++ ql/src/test/results/clientpositive/vector_nullsafe_join.q.out @@ -5,10 +5,6 @@ PREHOOK: query: -- SORT_QUERY_RESULTS -- results are the same (HIVE-10628 shows native will produce the wrong results -- otherwise). -- --- This query for "HIVE-3315 join predicate transitive" triggers HIVE-10640- --- explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- CREATE TABLE myinput1_txt(key int, value int) PREHOOK: type: CREATETABLE PREHOOK: Output: database:default @@ -20,10 +16,6 @@ POSTHOOK: query: -- SORT_QUERY_RESULTS -- results are the same (HIVE-10628 shows native will produce the wrong results -- otherwise). -- --- This query for "HIVE-3315 join predicate transitive" triggers HIVE-10640- --- explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL; --- CREATE TABLE myinput1_txt(key int, value int) POSTHOOK: type: CREATETABLE POSTHOOK: Output: database:default @@ -626,6 +618,93 @@ NULL 35 NULL NULL NULL NULL 10 NULL NULL NULL 48 NULL NULL NULL NULL NULL +PREHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +POSTHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-4 is a root stage + Stage-3 depends on stages: Stage-4 + Stage-0 depends on stages: Stage-3 + +STAGE PLANS: + Stage: Stage-4 + Map Reduce Local Work + Alias -> Map Local Tables: + a + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + a + TableScan + alias: a + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: key is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + HashTable Sink Operator + keys: + 0 null (type: int) + 1 null (type: int) + + Stage: Stage-3 + Map Reduce + Map Operator Tree: + TableScan + alias: b + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: value is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 null (type: int) + 1 null (type: int) + nullSafes: [true] + outputColumnNames: _col1, _col5 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: null (type: int), _col1 (type: int), _col5 (type: int), null (type: int) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 3 Data size: 13 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 + Local Work: + Map Reduce Local Work + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +PREHOOK: Input: default@myinput1 +#### A masked pattern was here #### +POSTHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +POSTHOOK: Input: default@myinput1 +#### A masked pattern was here #### +NULL 10 10 NULL +NULL 10 48 NULL +NULL 10 NULL NULL +NULL 35 10 NULL +NULL 35 48 NULL +NULL 35 NULL NULL +NULL NULL 10 NULL +NULL NULL 48 NULL +NULL NULL NULL NULL PREHOOK: query: -- merging explain select * from myinput1 a join myinput1 b on a.key<=>b.value PREHOOK: type: QUERY @@ -1206,3 +1285,90 @@ NULL 35 NULL NULL NULL NULL 10 NULL NULL NULL 48 NULL NULL NULL NULL NULL +PREHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +POSTHOOK: query: -- Query for "HIVE-3315 join predicate transitive" +explain select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +STAGE DEPENDENCIES: + Stage-4 is a root stage + Stage-3 depends on stages: Stage-4 + Stage-0 depends on stages: Stage-3 + +STAGE PLANS: + Stage: Stage-4 + Map Reduce Local Work + Alias -> Map Local Tables: + a + Fetch Operator + limit: -1 + Alias -> Map Local Operator Tree: + a + TableScan + alias: a + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: key is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + HashTable Sink Operator + keys: + 0 null (type: int) + 1 null (type: int) + + Stage: Stage-3 + Map Reduce + Map Operator Tree: + TableScan + alias: b + Statistics: Num rows: 6 Data size: 24 Basic stats: COMPLETE Column stats: NONE + Filter Operator + predicate: value is null (type: boolean) + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: NONE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 null (type: int) + 1 null (type: int) + nullSafes: [true] + outputColumnNames: _col1, _col5 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + Select Operator + expressions: null (type: int), _col1 (type: int), _col5 (type: int), null (type: int) + outputColumnNames: _col0, _col1, _col2, _col3 + Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE + File Output Operator + compressed: false + Statistics: Num rows: 3 Data size: 13 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 + Local Work: + Map Reduce Local Work + Execution mode: vectorized + + Stage: Stage-0 + Fetch Operator + limit: -1 + Processor Tree: + ListSink + +PREHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +PREHOOK: type: QUERY +PREHOOK: Input: default@myinput1 +#### A masked pattern was here #### +POSTHOOK: query: select * from myinput1 a join myinput1 b on a.key<=>b.value AND a.key is NULL +POSTHOOK: type: QUERY +POSTHOOK: Input: default@myinput1 +#### A masked pattern was here #### +NULL 10 10 NULL +NULL 10 48 NULL +NULL 10 NULL NULL +NULL 35 10 NULL +NULL 35 48 NULL +NULL 35 NULL NULL +NULL NULL 10 NULL +NULL NULL 48 NULL +NULL NULL NULL NULL