This is an automated email from the ASF dual-hosted git repository.
philo 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 4ffd2b1e3 [VL] Enable weekofyear function (#5371)
4ffd2b1e3 is described below
commit 4ffd2b1e3797a329d1b172aaf346bef683a58d73
Author: Yang Zhang <[email protected]>
AuthorDate: Fri Apr 12 15:09:29 2024 +0800
[VL] Enable weekofyear function (#5371)
---
.../apache/gluten/execution/ScalarFunctionsValidateSuite.scala | 10 ++++++++++
cpp/velox/substrait/SubstraitToVeloxExpr.cc | 1 +
2 files changed, 11 insertions(+)
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 bfae3f37b..6fceb7364 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
@@ -747,6 +747,16 @@ class ScalarFunctionsValidateSuite extends
FunctionsValidateTest {
}
}
+ test("weekofyear") {
+ withTable("t") {
+ sql("create table t (dt date) using parquet")
+ sql("insert into t values(date '2008-02-20')")
+ runQueryAndCompare("select weekofyear(dt) from t") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
+
test("try_add") {
runQueryAndCompare(
"select try_add(cast(l_orderkey as int), 1), try_add(cast(l_orderkey as
int), 2147483647)" +
diff --git a/cpp/velox/substrait/SubstraitToVeloxExpr.cc
b/cpp/velox/substrait/SubstraitToVeloxExpr.cc
index 7d578407c..8c8af593a 100644
--- a/cpp/velox/substrait/SubstraitToVeloxExpr.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxExpr.cc
@@ -623,6 +623,7 @@ std::unordered_map<std::string, std::string>
SubstraitVeloxExprConverter::extrac
{"MONTH", "month"},
{"QUARTER", "quarter"},
{"YEAR", "year"},
+ {"WEEK_OF_YEAR", "week_of_year"},
{"YEAR_OF_WEEK", "week_of_year"}};
} // namespace gluten
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]