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 26410ba9ff [VL] Add trunc support (#9761)
26410ba9ff is described below
commit 26410ba9ff3b2e5265d25ed85b1b9d969722a503
Author: Mingliang Zhu <[email protected]>
AuthorDate: Tue Jun 10 21:33:53 2025 +0800
[VL] Add trunc support (#9761)
---
.../gluten/functions/DateFunctionsValidateSuite.scala | 18 ++++++++++++++++++
cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc | 2 +-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git
a/backends-velox/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala
b/backends-velox/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala
index 33334e4b6f..e85ef46944 100644
---
a/backends-velox/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala
+++
b/backends-velox/src/test/scala/org/apache/gluten/functions/DateFunctionsValidateSuite.scala
@@ -328,6 +328,24 @@ abstract class DateFunctionsValidateSuite extends
FunctionsValidateSuite {
}
}
+ test("trunc") {
+ withTempPath {
+ path =>
+ Seq(
+ java.sql.Date.valueOf("2008-02-20"),
+ java.sql.Date.valueOf("2022-01-01")
+ )
+ .toDF("dt")
+ .write
+ .parquet(path.getCanonicalPath)
+
+ spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("t")
+ runQueryAndCompare("select trunc(dt, 'week') from t") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
+
test("unix_date") {
withTempPath {
path =>
diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
index 50c3a9a84e..553e668dd4 100644
--- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
+++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc
@@ -59,7 +59,7 @@ const std::unordered_set<std::string> kRegexFunctions = {
"rlike"};
const std::unordered_set<std::string> kBlackList =
- {"split_part", "trunc", "sequence", "approx_percentile",
"get_array_struct_fields", "map_from_arrays"};
+ {"split_part", "sequence", "approx_percentile", "get_array_struct_fields",
"map_from_arrays"};
} // namespace
bool SubstraitToVeloxPlanValidator::parseVeloxType(
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]