diff --git a/backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionTransformer.scala b/backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionTransformer.scala index 51b19ab140d9..eb34610aba72 100644 --- a/backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionTransformer.scala +++ b/backends-velox/src/main/scala/org/apache/gluten/expression/ExpressionTransformer.scala @@ -129,9 +129,9 @@ case class VeloxStringSplitTransformer( val limit = limitExpr.doTransform(args).asInstanceOf[IntLiteralNode].getValue val regex = regexExpr.doTransform(args).asInstanceOf[StringLiteralNode].getValue - if (limit > 0 || regex.length > 1) { + if (limit > 0 || regex.length != 1 || regex.charAt(0) > 127) { throw new GlutenNotSupportException( - s"$original supported single-length regex and negative limit, but given $limit and $regex") + s"$original supported single-length ASCII regex and negative limit, but given $limit and $regex") } super.doTransform(args) diff --git a/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxStringFunctionsSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxStringFunctionsSuite.scala index 2aedde12a5a9..f8ff57238d71 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxStringFunctionsSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/execution/VeloxStringFunctionsSuite.scala @@ -536,6 +536,16 @@ class VeloxStringFunctionsSuite extends VeloxWholeStageTransformerSuite { runQueryAndCompare( s"select l_orderkey, split(l_comment, 'h') " + s"from $LINEITEM_TABLE limit 5") { _ => } + + runQueryAndCompare( + s"select l_orderkey, split(l_comment, '') " + + s"from $LINEITEM_TABLE limit 5", noFallBack = false) { _ => } + + // scalastyle:off nonascii + runQueryAndCompare( + s"select l_orderkey, split(l_comment, ',') " + + s"from $LINEITEM_TABLE limit 5", noFallBack = false) { _ => } + // scalastyle:on nonascii } test("substr") {