This is an automated email from the ASF dual-hosted git repository.

zhli 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 f79f0528bf [GLUTEN-8319][VL] Support date_format Spark function (#8323)
f79f0528bf is described below

commit f79f0528bf620ec375365fc8000370e67d492b9d
Author: PHILO-HE <[email protected]>
AuthorDate: Mon Jan 13 12:59:06 2025 +0800

    [GLUTEN-8319][VL] Support date_format Spark function (#8323)
    
    [GLUTEN-8319][VL] Support date_format Spark function.
    facebookincubator/velox#11953.
---
 .../gluten/execution/ScalarFunctionsValidateSuite.scala   | 15 +++++++++++++++
 cpp/velox/substrait/SubstraitParser.cc                    |  1 -
 2 files changed, 15 insertions(+), 1 deletion(-)

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 0d0607d3b9..94c69abd8d 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 006a20c232..bdbcc2785d 100644
--- a/cpp/velox/substrait/SubstraitParser.cc
+++ b/cpp/velox/substrait/SubstraitParser.cc
@@ -404,7 +404,6 @@ std::unordered_map<std::string, std::string> 
SubstraitParser::substraitVeloxFunc
     {"murmur3hash", "hash_with_seed"},
     {"xxhash64", "xxhash64_with_seed"},
     {"modulus", "remainder"},
-    {"date_format", "format_datetime"},
     {"negative", "unaryminus"},
     {"get_array_item", "get"}};
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to