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