Skip to content

Commit

Permalink
[VL] Support KnownNullable for Spark 3.5 (#6193)
Browse files Browse the repository at this point in the history
[VL] Support KnownNullable for Spark 3.5.
  • Loading branch information
zhli1142015 authored Jun 24, 2024
1 parent e0fcfe5 commit 0ef2f82
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.gluten.execution

import org.apache.spark.sql.execution.ProjectExec
import org.apache.spark.sql.types._

import java.sql.Timestamp
Expand Down Expand Up @@ -1145,7 +1146,18 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
runQueryAndCompare(
"SELECT a, window.start, window.end, count(*) as cnt FROM" +
" string_timestamp GROUP by a, window(b, '5 minutes') ORDER BY a, start;") {
checkGlutenOperatorMatch[ProjectExecTransformer]
df =>
val executedPlan = getExecutedPlan(df)
assert(
executedPlan.exists(plan => plan.isInstanceOf[ProjectExecTransformer]),
s"Expect ProjectExecTransformer exists " +
s"in executedPlan:\n ${executedPlan.last}"
)
assert(
!executedPlan.exists(plan => plan.isInstanceOf[ProjectExec]),
s"Expect ProjectExec doesn't exist " +
s"in executedPlan:\n ${executedPlan.last}"
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class Spark35Shims extends SparkShims {
Sig[SplitPart](ExpressionNames.SPLIT_PART),
Sig[Sec](ExpressionNames.SEC),
Sig[Csc](ExpressionNames.CSC),
Sig[Empty2Null](ExpressionNames.EMPTY2NULL))
Sig[KnownNullable](ExpressionNames.KNOWN_NULLABLE),
Sig[Empty2Null](ExpressionNames.EMPTY2NULL)
)
}

override def aggregateExpressionMappings: Seq[Sig] = {
Expand Down

0 comments on commit 0ef2f82

Please sign in to comment.