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 12e770327b55..b71457555e29 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 f9f9fe8e0c01..479139f7a932 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] }