From 45f61d8efe18985f1522a0cf8926d7e1535a39ff Mon Sep 17 00:00:00 2001 From: philo Date: Tue, 6 Sep 2022 13:17:43 +0800 Subject: [PATCH] Initial commit --- .../expression/ColumnarBinaryExpression.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarBinaryExpression.scala b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarBinaryExpression.scala index 4acc54dd6..eff1cfda9 100644 --- a/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarBinaryExpression.scala +++ b/native-sql-engine/core/src/main/scala/com/intel/oap/expression/ColumnarBinaryExpression.scala @@ -82,6 +82,22 @@ class ColumnarGetJsonObject(left: Expression, right: Expression, original: GetJs with ColumnarExpression with Logging { + buildCheck + + // Only literal json path is supported and wildcard is not supported. + def buildCheck: Unit = { + right match { + case literal: ColumnarLiteral => + val jsonPath = literal.value.toString + if (jsonPath.contains("*")) { + throw new UnsupportedOperationException("Wildcard is NOT supported" + + " in json path for get_json_object.") + } + case _ => + throw new UnsupportedOperationException("Only literal json path is supported!") + } + } + // TODO: currently we have a codegen implementation, but needs to be optimized. override def supportColumnarCodegen(args: java.lang.Object): Boolean = { false