diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/JoinTypeCheckCtx.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/JoinTypeCheckCtx.java index 4e42197..871518c 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/JoinTypeCheckCtx.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/JoinTypeCheckCtx.java @@ -54,7 +54,7 @@ public JoinTypeCheckCtx(RowResolver leftRR, RowResolver rightRR, JoinType hiveJoinType) throws SemanticException { super(RowResolver.getCombinedRR(leftRR, rightRR), true, false, false, false, false, false, false, false, - false, false); + true, false); this.inputRRLst = ImmutableList.of(leftRR, rightRR); this.outerJoin = (hiveJoinType == JoinType.LEFTOUTER) || (hiveJoinType == JoinType.RIGHTOUTER) || (hiveJoinType == JoinType.FULLOUTER); diff --git a/ql/src/test/queries/clientpositive/vector_complex_join.q b/ql/src/test/queries/clientpositive/vector_complex_join.q index db407bc..dbdc36a 100644 --- a/ql/src/test/queries/clientpositive/vector_complex_join.q +++ b/ql/src/test/queries/clientpositive/vector_complex_join.q @@ -23,7 +23,6 @@ INSERT OVERWRITE TABLE test2a SELECT ARRAY(1, 2), 1 FROM src LIMIT 1; CREATE TABLE test2b (a INT) STORED AS ORC; INSERT OVERWRITE TABLE test2b VALUES (2), (3), (4); -set hive.cbo.enable=false; explain vectorization expression select * from test2b join test2a on test2b.a = test2a.a[1]; diff --git a/ql/src/test/results/clientpositive/llap/vector_complex_join.q.out b/ql/src/test/results/clientpositive/llap/vector_complex_join.q.out index 3a0c6a4..98e7dc0 100644 --- a/ql/src/test/results/clientpositive/llap/vector_complex_join.q.out +++ b/ql/src/test/results/clientpositive/llap/vector_complex_join.q.out @@ -233,27 +233,27 @@ STAGE PLANS: predicateExpression: SelectColumnIsNotNull(col 0:int) predicate: a is not null (type: boolean) Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE - Map Join Operator - condition map: - Inner Join 0 to 1 - keys: - 0 a (type: int) - 1 a[1] (type: int) - Map Join Vectorization: - className: VectorMapJoinInnerLongOperator + Select Operator + expressions: a (type: int) + outputColumnNames: _col0 + Select Vectorization: + className: VectorSelectOperator native: true - nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true - outputColumnNames: _col0, _col4, _col5 - input vertices: - 1 Map 2 - Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE - Select Operator - expressions: _col0 (type: int), _col4 (type: array), _col5 (type: int) - outputColumnNames: _col0, _col1, _col2 - Select Vectorization: - className: VectorSelectOperator + projectedOutputColumnNums: [0] + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0[1] (type: int) + Map Join Vectorization: + className: VectorMapJoinInnerLongOperator native: true - projectedOutputColumnNums: [0, 2, 3] + nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true + outputColumnNames: _col0, _col1, _col2 + input vertices: + 1 Map 2 Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false @@ -290,17 +290,25 @@ STAGE PLANS: predicateExpression: SelectColumnIsNotNull(col 3:int)(children: ListIndexColScalar(col 0:array, col 1:int) -> 3:int) predicate: a[1] is not null (type: boolean) Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE - Reduce Output Operator - key expressions: a[1] (type: int) - sort order: + - Map-reduce partition columns: a[1] (type: int) - Reduce Sink Vectorization: - className: VectorReduceSinkLongOperator - keyExpressions: ListIndexColScalar(col 0:array, col 1:int) -> 3:int + Select Operator + expressions: a (type: array), index (type: int) + outputColumnNames: _col0, _col1 + Select Vectorization: + className: VectorSelectOperator native: true - nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true + projectedOutputColumnNums: [0, 1] Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE - value expressions: a (type: array), index (type: int) + Reduce Output Operator + key expressions: _col0[1] (type: int) + sort order: + + Map-reduce partition columns: _col0[1] (type: int) + Reduce Sink Vectorization: + className: VectorReduceSinkLongOperator + keyExpressions: ListIndexColScalar(col 0:array, col 1:int) -> 3:int + native: true + nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: array), _col1 (type: int) Execution mode: vectorized, llap LLAP IO: all inputs Map Vectorization: @@ -368,27 +376,27 @@ STAGE PLANS: predicateExpression: SelectColumnIsNotNull(col 0:int) predicate: a is not null (type: boolean) Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE - Map Join Operator - condition map: - Inner Join 0 to 1 - keys: - 0 a (type: int) - 1 a[index] (type: int) - Map Join Vectorization: - className: VectorMapJoinInnerLongOperator + Select Operator + expressions: a (type: int) + outputColumnNames: _col0 + Select Vectorization: + className: VectorSelectOperator native: true - nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true - outputColumnNames: _col0, _col4, _col5 - input vertices: - 1 Map 2 - Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE - Select Operator - expressions: _col0 (type: int), _col4 (type: array), _col5 (type: int) - outputColumnNames: _col0, _col1, _col2 - Select Vectorization: - className: VectorSelectOperator + projectedOutputColumnNums: [0] + Statistics: Num rows: 3 Data size: 12 Basic stats: COMPLETE Column stats: COMPLETE + Map Join Operator + condition map: + Inner Join 0 to 1 + keys: + 0 _col0 (type: int) + 1 _col0[_col1] (type: int) + Map Join Vectorization: + className: VectorMapJoinInnerLongOperator native: true - projectedOutputColumnNums: [0, 2, 3] + nativeConditionsMet: hive.mapjoin.optimized.hashtable IS true, hive.vectorized.execution.mapjoin.native.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, One MapJoin Condition IS true, No nullsafe IS true, Small table vectorizes IS true, Optimized Table and Supports Key Types IS true + outputColumnNames: _col0, _col1, _col2 + input vertices: + 1 Map 2 Statistics: Num rows: 3 Data size: 13 Basic stats: COMPLETE Column stats: NONE File Output Operator compressed: false @@ -425,17 +433,25 @@ STAGE PLANS: predicateExpression: SelectColumnIsNotNull(col 3:int)(children: ListIndexColColumn(col 0:array, col 1:int) -> 3:int) predicate: a[index] is not null (type: boolean) Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE - Reduce Output Operator - key expressions: a[index] (type: int) - sort order: + - Map-reduce partition columns: a[index] (type: int) - Reduce Sink Vectorization: - className: VectorReduceSinkLongOperator - keyExpressions: ListIndexColColumn(col 0:array, col 1:int) -> 3:int + Select Operator + expressions: a (type: array), index (type: int) + outputColumnNames: _col0, _col1 + Select Vectorization: + className: VectorSelectOperator native: true - nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true + projectedOutputColumnNums: [0, 1] Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE - value expressions: a (type: array), index (type: int) + Reduce Output Operator + key expressions: _col0[_col1] (type: int) + sort order: + + Map-reduce partition columns: _col0[_col1] (type: int) + Reduce Sink Vectorization: + className: VectorReduceSinkLongOperator + keyExpressions: ListIndexColColumn(col 0:array, col 1:int) -> 3:int + native: true + nativeConditionsMet: hive.vectorized.execution.reducesink.new.enabled IS true, hive.execution.engine tez IN [tez, spark] IS true, No PTF TopN IS true, No DISTINCT columns IS true, BinarySortableSerDe for keys IS true, LazyBinarySerDe for values IS true + Statistics: Num rows: 1 Data size: 124 Basic stats: COMPLETE Column stats: NONE + value expressions: _col0 (type: array), _col1 (type: int) Execution mode: vectorized, llap LLAP IO: all inputs Map Vectorization: