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

taiyang-li pushed a commit to branch fake_add_bolt_backend
in repository https://gitbox.apache.org/repos/asf/gluten.git

commit cdbbb62a8894ed2440eaec5cb3f5fe060c6c5093
Author: liyang.127 <[email protected]>
AuthorDate: Fri Jun 26 15:59:01 2026 +0800

    [GLUTEN][VL] Support sequence function in Velox backend
    
    Remove "sequence" from the validator black list so that the Spark
    sequence expression can be offloaded to Velox, which natively supports
    sequence for integral/date/timestamp inputs. Add a UT covering column
    inputs (non constant-folding) and update the scalar function support doc.
    
    Generated-by: TraeCli openrouter-3o
---
 .../gluten/functions/ScalarFunctionsValidateSuite.scala       | 11 +++++++++++
 cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc          |  2 +-
 docs/velox-backend-scalar-function-support.md                 |  4 ++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git 
a/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala
 
b/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala
index 74b2933a67..38db4e9b3a 100644
--- 
a/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala
+++ 
b/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala
@@ -540,6 +540,17 @@ abstract class ScalarFunctionsValidateSuite extends 
FunctionsValidateSuite {
     }
   }
 
+  test("sequence function with column inputs offloaded to native") {
+    runQueryAndCompare("""SELECT sequence(1, l_linenumber), l_orderkey
+                         | from lineitem limit 100""".stripMargin) {
+      checkGlutenPlan[ProjectExecTransformer]
+    }
+    runQueryAndCompare("""SELECT sequence(l_linenumber, l_linenumber + 5, 2), 
l_orderkey
+                         | from lineitem limit 100""".stripMargin) {
+      checkGlutenPlan[ProjectExecTransformer]
+    }
+  }
+
   test("map_from_arrays optimized by Spark constant folding") {
     withSQLConf(("spark.sql.optimizer.excludedRules", "")) {
       runQueryAndCompare("""SELECT map_from_arrays(sequence(1, 5),sequence(1, 
5)), l_orderkey
diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc 
b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index 767af98c76..75d691bea5 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -56,7 +56,7 @@ const char* extractFileName(const char* file) {
 const std::unordered_set<std::string> kRegexFunctions =
     {"regexp_extract", "regexp_extract_all", "regexp_replace", "rlike", 
"split"};
 
-const std::unordered_set<std::string> kBlackList = {"split_part", "sequence", 
"approx_percentile", "map_from_arrays"};
+const std::unordered_set<std::string> kBlackList = {"split_part", 
"approx_percentile", "map_from_arrays"};
 } // namespace
 
 bool SubstraitToVeloxPlanValidator::parseVeloxType(
diff --git a/docs/velox-backend-scalar-function-support.md 
b/docs/velox-backend-scalar-function-support.md
index e16baf3701..1da7586a6d 100644
--- a/docs/velox-backend-scalar-function-support.md
+++ b/docs/velox-backend-scalar-function-support.md
@@ -1,6 +1,6 @@
 # Scalar Functions Support Status
 
-**Out of 357 scalar functions in Spark 3.5, Gluten currently fully supports 
242 functions and partially supports 25 functions.**
+**Out of 357 scalar functions in Spark 3.5, Gluten currently fully supports 
243 functions and partially supports 25 functions.**
 
 ## Array Functions
 
@@ -26,7 +26,7 @@
 | arrays_zip        | ArraysZip           | S        |                |
 | flatten           | Flatten             | S        |                |
 | get               | Get                 | S        |                |
-| sequence          | Sequence            |          |                |
+| sequence          | Sequence            | S        |                |
 | shuffle           | Shuffle             | S        |                |
 | slice             | Slice               | S        |                |
 | sort_array        | SortArray           | S        |                |


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

Reply via email to