This is an automated email from the ASF dual-hosted git repository.

rui pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new cb02cdb0a [VL] Enable length function for binary type (#5761)
cb02cdb0a is described below

commit cb02cdb0a4095a8f194e62268147182afd48821c
Author: Zhen Li <[email protected]>
AuthorDate: Thu May 16 13:51:29 2024 +0800

    [VL] Enable length function for binary type (#5761)
---
 .../apache/gluten/execution/ScalarFunctionsValidateSuite.scala    | 8 ++++++++
 cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc              | 6 ------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git 
a/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
 
b/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
index 834e172f8..e88e9699a 100644
--- 
a/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
+++ 
b/backends-velox/src/test/scala/org/apache/gluten/execution/ScalarFunctionsValidateSuite.scala
@@ -977,4 +977,12 @@ class ScalarFunctionsValidateSuite extends 
FunctionsValidateTest {
         }
     }
   }
+
+  test("length") {
+    runQueryAndCompare(
+      "select length(c_comment), length(cast(c_comment as binary))" +
+        " from customer limit 50") {
+      checkGlutenOperatorMatch[ProjectExecTransformer]
+    }
+  }
 }
diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc 
b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index fc8b912e0..51f39a3ab 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -191,12 +191,6 @@ bool SubstraitToVeloxPlanValidator::validateScalarFunction(
     return validateRound(scalarFunction, inputType);
   } else if (name == "extract") {
     return validateExtractExpr(params);
-  } else if (name == "char_length") {
-    VELOX_CHECK(types.size() == 1);
-    if (types[0] == "vbin") {
-      LOG_VALIDATION_MSG("Binary type is not supported in " + name);
-      return false;
-    }
   } else if (name == "map_from_arrays") {
     LOG_VALIDATION_MSG("map_from_arrays is not supported.");
     return false;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to