This is an automated email from the ASF dual-hosted git repository. zjuwangg pushed a commit to branch feat_sequence in repository https://gitbox.apache.org/repos/asf/gluten.git
commit 0c3a0cb09b27adeafca53ff5aab33745967edb06 Author: Terry Wang <[email protected]> AuthorDate: Wed Jun 17 11:15:49 2026 +0800 feat: support sequence fucntion --- .../gluten/functions/ScalarFunctionsValidateSuite.scala | 17 +++++++++++++++++ cpp/bolt/substrait/SubstraitToBoltPlanValidator.cc | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/backends-bolt/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala b/backends-bolt/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala index fbae98b74f..7aa775fa00 100644 --- a/backends-bolt/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala +++ b/backends-bolt/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala @@ -535,6 +535,23 @@ abstract class ScalarFunctionsValidateSuite extends FunctionsValidateSuite { } } + test("sequence") { + withSQLConf(("spark.sql.optimizer.excludedRules", NullPropagation.ruleName)) { + runQueryAndCompare("""SELECT sequence(l_orderkey, l_orderkey + 5), l_orderkey + | from lineitem limit 100""".stripMargin) { + checkGlutenOperatorMatch[ProjectExecTransformer] + } + runQueryAndCompare("""SELECT sequence(l_orderkey, l_orderkey + 10, 2), l_orderkey + | from lineitem limit 100""".stripMargin) { + checkGlutenOperatorMatch[ProjectExecTransformer] + } + runQueryAndCompare("""SELECT sequence(l_orderkey + 5, l_orderkey, -1), l_orderkey + | from lineitem limit 100""".stripMargin) { + checkGlutenOperatorMatch[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/bolt/substrait/SubstraitToBoltPlanValidator.cc b/cpp/bolt/substrait/SubstraitToBoltPlanValidator.cc index bd997c9994..e1a65674b6 100644 --- a/cpp/bolt/substrait/SubstraitToBoltPlanValidator.cc +++ b/cpp/bolt/substrait/SubstraitToBoltPlanValidator.cc @@ -59,7 +59,7 @@ const std::unordered_set<std::string> kRegexFunctions = { "rlike"}; const std::unordered_set<std::string> kBlackList = - {"split_part", "sequence", "approx_percentile", "map_from_arrays"}; + {"split_part", "approx_percentile", "map_from_arrays"}; } // namespace bool SubstraitToBoltPlanValidator::parseBoltType( --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
