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 0d0607d3b93e..94c69abd8d32 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 @@ -1515,4 +1515,19 @@ abstract class ScalarFunctionsValidateSuite extends FunctionsValidateSuite { } } } + + test("date_format") { + withTempPath { + path => + val t1 = Timestamp.valueOf("2024-08-22 10:10:10.010") + val t2 = Timestamp.valueOf("2014-12-31 00:00:00.012") + val t3 = Timestamp.valueOf("1968-12-31 23:59:59.001") + Seq(t1, t2, t3).toDF("c0").write.parquet(path.getCanonicalPath) + + spark.read.parquet(path.getCanonicalPath).createOrReplaceTempView("t") + runQueryAndCompare("SELECT date_format(c0, 'yyyy') FROM t") { + checkGlutenOperatorMatch[ProjectExecTransformer] + } + } + } } diff --git a/cpp/velox/substrait/SubstraitParser.cc b/cpp/velox/substrait/SubstraitParser.cc index 006a20c232ea..bdbcc2785ded 100644 --- a/cpp/velox/substrait/SubstraitParser.cc +++ b/cpp/velox/substrait/SubstraitParser.cc @@ -404,7 +404,6 @@ std::unordered_map SubstraitParser::substraitVeloxFunc {"murmur3hash", "hash_with_seed"}, {"xxhash64", "xxhash64_with_seed"}, {"modulus", "remainder"}, - {"date_format", "format_datetime"}, {"negative", "unaryminus"}, {"get_array_item", "get"}};