File tree Expand file tree Collapse file tree 2 files changed +42034
-0
lines changed
backends-velox/src/test/scala/org/apache/gluten/functions Expand file tree Collapse file tree 2 files changed +42034
-0
lines changed Original file line number Diff line number Diff line change @@ -1521,4 +1521,22 @@ abstract class ScalarFunctionsValidateSuite extends FunctionsValidateSuite {
15211521 }
15221522 }
15231523 }
1524+
1525+ test(" current_timestamp" ) {
1526+ withSQLConf(" spark.sql.optimizer.excludedRules" -> " " ) {
1527+ val df = spark.sql(" SELECT current_timestamp()" )
1528+
1529+ val optimizedPlan = df.queryExecution.optimizedPlan.toString()
1530+ assert(
1531+ optimizedPlan.contains(" Project" ) && ! optimizedPlan.contains(" CurrentTimestamp" ),
1532+ s " Expected CurrentTimestamp to be folded to a literal, but got: $optimizedPlan"
1533+ )
1534+
1535+ checkFallbackOperators(df, 0 )
1536+
1537+ val result = df.collect()
1538+ assert(result.length == 1 , " Expected exactly one row" )
1539+ assert(result(0 ).getTimestamp(0 ) != null , " Expected a non-null timestamp" )
1540+ }
1541+ }
15241542}
You can’t perform that action at this time.
0 commit comments