From e3e779390edcb476876ba85ba89e19bb8ec0f896 Mon Sep 17 00:00:00 2001 From: jackylee-ch Date: Tue, 19 Jul 2022 18:12:38 +0800 Subject: [PATCH 1/3] fix: missing WSCG check for keys in join --- .../oap/execution/ColumnarShuffledHashJoinExec.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala index 216510b25..af8b84ed2 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala @@ -128,6 +128,18 @@ case class ColumnarShuffledHashJoinExec( case _ => throw new UnsupportedOperationException(s"Join Type ${joinType} is not supported yet.") } + // build check for leftKeys and rightKeys + leftKeys.union(rightKeys).foreach { expr => + val keyExpr = + ColumnarExpressionConverter.replaceWithColumnarExpression(expr) + val supportCodegen = + keyExpr.asInstanceOf[ColumnarExpression].supportColumnarCodegen(null) + this.supportCodegen = this.supportCodegen && supportCodegen + if (!supportCodegen) { + throw new UnsupportedOperationException( + "Condition expression is not fully supporting codegen!") + } + } // build check for condition val conditionExpr: Expression = condition.orNull if (conditionExpr != null) { From ee1e297f39dd1c8a0d50bad3327a12b1ec6c9647 Mon Sep 17 00:00:00 2001 From: jackylee-ch Date: Wed, 20 Jul 2022 12:46:40 +0800 Subject: [PATCH 2/3] change comment --- .../com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala index af8b84ed2..007fa7c93 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala @@ -137,7 +137,7 @@ case class ColumnarShuffledHashJoinExec( this.supportCodegen = this.supportCodegen && supportCodegen if (!supportCodegen) { throw new UnsupportedOperationException( - "Condition expression is not fully supporting codegen!") + "Left or Right key expressions are not fully supporting codegen!") } } // build check for condition From 8246fb6b99a80cdd8b41534fba0e8db2c2f6b36d Mon Sep 17 00:00:00 2001 From: jackylee-ch Date: Wed, 20 Jul 2022 14:36:19 +0800 Subject: [PATCH 3/3] remove UnsupportedOperationException in join key check --- .../intel/oap/execution/ColumnarShuffledHashJoinExec.scala | 4 ---- 1 file changed, 4 deletions(-) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala index 007fa7c93..eb7af868f 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/execution/ColumnarShuffledHashJoinExec.scala @@ -135,10 +135,6 @@ case class ColumnarShuffledHashJoinExec( val supportCodegen = keyExpr.asInstanceOf[ColumnarExpression].supportColumnarCodegen(null) this.supportCodegen = this.supportCodegen && supportCodegen - if (!supportCodegen) { - throw new UnsupportedOperationException( - "Left or Right key expressions are not fully supporting codegen!") - } } // build check for condition val conditionExpr: Expression = condition.orNull