This is an automated email from the ASF dual-hosted git repository.
rui 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 5a1f6f220e [GLUTEN-6784][GLUTEN-6828][VL] Add tests for weekOfYear and
cast string as date (#6888)
5a1f6f220e is described below
commit 5a1f6f220e617848e45877959edd3be3c43e0d05
Author: Mingliang Zhu <[email protected]>
AuthorDate: Thu Oct 10 17:08:25 2024 +0800
[GLUTEN-6784][GLUTEN-6828][VL] Add tests for weekOfYear and cast string as
date (#6888)
---
.../scala/org/apache/gluten/execution/MiscOperatorSuite.scala | 11 +++++++++++
.../gluten/execution/ScalarFunctionsValidateSuite.scala | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git
a/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala
b/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala
index 12e770327b..b71457555e 100644
---
a/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala
+++
b/backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala
@@ -1957,6 +1957,17 @@ class MiscOperatorSuite extends
VeloxWholeStageTransformerSuite with AdaptiveSpa
}
}
+ test("Cast string to date") {
+ withTempView("view") {
+ Seq("2023-01-01", "2023-01-02", "-1", "-111-01-01")
+ .toDF("dateColumn")
+ .createOrReplaceTempView("view")
+ runQueryAndCompare("SELECT cast(dateColumn as date) from view") {
+ checkGlutenOperatorMatch[ProjectExecTransformer]
+ }
+ }
+ }
+
test("Cast date to timestamp") {
withTempPath {
path =>
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 f9f9fe8e0c..479139f7a9 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
@@ -998,7 +998,7 @@ abstract class ScalarFunctionsValidateSuite extends
FunctionsValidateSuite {
test("extract date field") {
withTable("t") {
sql("create table t (dt date) using parquet")
- sql("insert into t values(date '2008-02-20')")
+ sql("insert into t values(date '2008-02-20'), (date '2022-01-01')")
runQueryAndCompare("select weekofyear(dt) from t") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]