This is an automated email from the ASF dual-hosted git repository.
zhouyuan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gluten.git
The following commit(s) were added to refs/heads/main by this push:
new 0259f98125 [GLUTEN-11622][TEST] Add native execution tests for
timestamp_ntz date functions
0259f98125 is described below
commit 0259f981258c3ce906c4fab643a7dfdb03d96514
Author: Mariam AlMesfer <[email protected]>
AuthorDate: Tue Oct 13 11:02:59 2026 +0300
[GLUTEN-11622][TEST] Add native execution tests for timestamp_ntz date
functions
---
.../functions/DateFunctionsValidateSuite.scala | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
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 103c8b8127..420da5db67 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
@@ -628,6 +628,41 @@ class DateFunctionsValidateSuite extends
FunctionsValidateSuite {
"select make_timestamp_ntz(2021, 7, 11, 6, 30, 45.678) from view") {
checkGlutenPlan[ProjectExecTransformer]
}
+ // date_trunc(timestamp_ntz) runs natively; output is timestamp (no
NTZ propagation).
+ runQueryAndCompare("select date_trunc('year', ts) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // date_add/date_sub(timestamp_ntz) run natively; output is date (no
NTZ propagation).
+ runQueryAndCompare("select date_add(ts, 1) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ runQueryAndCompare("select date_sub(ts, 1) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // datediff(timestamp_ntz) runs natively; output is int (no NTZ
propagation).
+ runQueryAndCompare("select datediff(ts, ts) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // date_format(timestamp_ntz) runs natively; output is string (no NTZ
propagation).
+ runQueryAndCompare("select date_format(ts, 'yyyy') from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // to_utc_timestamp(timestamp_ntz) runs natively; output is timestamp
(no NTZ propagation).
+ runQueryAndCompare("select to_utc_timestamp(ts, 'America/Los_Angeles')
from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // from_utc_timestamp(timestamp_ntz) runs natively; output is
timestamp (no NTZ).
+ runQueryAndCompare("select from_utc_timestamp(ts,
'America/Los_Angeles') from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // year/month/day(timestamp_ntz) run natively; output is int (no NTZ
propagation).
+ runQueryAndCompare("select year(ts), month(ts), day(ts) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
+ // extract(timestamp_ntz) runs natively; output is int (no NTZ
propagation).
+ runQueryAndCompare("select extract(year from ts) from view") {
+ checkGlutenPlan[ProjectExecTransformer]
+ }
// cast(timestamp_ntz as timestamp)
runQueryAndCompare("select cast(ts as timestamp) from view") {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]