From 5a41c36bed006ab4c5e326b9231c073e9f6f571c Mon Sep 17 00:00:00 2001 From: philo Date: Tue, 24 May 2022 09:57:19 +0800 Subject: [PATCH] Fix found issues --- .../oap/expression/ColumnarExpressionConverter.scala | 11 ++++++++++- .../oap/expression/ColumnarTernaryOperator.scala | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarExpressionConverter.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarExpressionConverter.scala index a96a14f43..9b4a10cba 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarExpressionConverter.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarExpressionConverter.scala @@ -419,7 +419,7 @@ object ColumnarExpressionConverter extends Logging { replaceWithColumnarExpression( getArrayItem.ordinal, convertBoundRefToAttrRef = convertBoundRefToAttrRef), - new ColumnarStringSplitPart(strSplit.str, strSplit.regex, getArrayItem.ordinal, null)) + new StringSplitPart(strSplit.str, strSplit.regex, getArrayItem.ordinal, null)) case other => throw new UnsupportedOperationException( s" --> ${other.getClass} | ${other} is not currently" + @@ -479,6 +479,15 @@ object ColumnarExpressionConverter extends Logging { return true case c: Concat => c.children.map(containsSubquery).exists(_ == true) + case getArrayItem: GetArrayItem => + getArrayItem.child match { + case strSplit: StringSplit => + strSplit.children.map(containsSubquery).exists(_ == true) + case other => + throw new UnsupportedOperationException( + s" --> ${other.getClass} | ${other} is not currently" + + s" supported as child of GetArrayItem.") + } case b: BinaryExpression => containsSubquery(b.left) || containsSubquery(b.right) case s: String2TrimExpression => diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarTernaryOperator.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarTernaryOperator.scala index de6ff991b..61ae91599 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarTernaryOperator.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarTernaryOperator.scala @@ -272,7 +272,7 @@ object ColumnarTernaryOperator { new ColumnarSubString(src, arg1, arg2, ss) // Currently not supported. case ssp: StringSplitPart => - new ColumnarStringSplitPart(ssp.str, ssp.regex, ssp.limit, ssp) + new ColumnarStringSplitPart(src, arg1, arg2, ssp) case st: StringTranslate => new ColumnarStringTranslate(src, arg1, arg2, st) case sl: StringLocate =>