File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
backends-velox/src/test/scala/org/apache/gluten/functions Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1521,4 +1521,27 @@ abstract class ScalarFunctionsValidateSuite extends FunctionsValidateSuite {
15211521 }
15221522 }
15231523 }
1524+ test(" test_current_timestamp" ) {
1525+ val df = spark.sql(" SELECT l_orderkey, current_timestamp() from lineitem limit 1" )
1526+ val optimizedPlan = df.queryExecution.optimizedPlan.toString()
1527+ assert(
1528+ ! optimizedPlan.contains(" CurrentTimestamp" ),
1529+ s " Expected CurrentTimestamp to be folded to a literal, but got: $optimizedPlan"
1530+ )
1531+ checkGlutenPlan[ProjectExecTransformer ](df)
1532+ checkFallbackOperators(df, 0 )
1533+ df.collect()
1534+ }
1535+
1536+ test(" test_now" ) {
1537+ val df = spark.sql(" SELECT l_orderkey, now() from lineitem limit 1" )
1538+ val optimizedPlan = df.queryExecution.optimizedPlan.toString()
1539+ assert(
1540+ ! optimizedPlan.contains(" Now" ),
1541+ s " Expected Now to be folded to a literal, but got: $optimizedPlan"
1542+ )
1543+ checkGlutenPlan[ProjectExecTransformer ](df)
1544+ checkFallbackOperators(df, 0 )
1545+ df.collect()
1546+ }
15241547}
You can’t perform that action at this time.
0 commit comments