This is an automated email from the ASF dual-hosted git repository. yangzy pushed a commit to branch fix-week-of-year in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git
commit aba3d4fc214d81acd56af5d67f4aba3c1b33bf8a Author: Yang Zhang <[email protected]> AuthorDate: Thu Apr 11 17:32:28 2024 +0800 fix --- .../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 d8e789d1c..5f0e20c8c 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 @@ -727,4 +727,14 @@ 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] + } + } + } + } diff --git a/cpp/velox/substrait/SubstraitToVeloxExpr.cc b/cpp/velox/substrait/SubstraitToVeloxExpr.cc index 02d57f276..114ad1452 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]
