-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-39453][SQL] DS V2 supports push down misc non-aggregate functions(non ANSI) #36830
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -425,6 +425,26 @@ class JDBCV2Suite extends QueryTest with SharedSparkSession with ExplainSuiteHel | |
checkFiltersRemoved(df10) | ||
checkPushedInfo(df10, "PushedFilters: [ID IS NOT NULL, ID > 1], ") | ||
checkAnswer(df10, Row("mary", 2)) | ||
|
||
val df11 = sql( | ||
""" | ||
|SELECT * FROM h2.test.employee | ||
|WHERE GREATEST(bonus, 1100) > 1200 AND LEAST(salary, 10000) > 9000 AND RAND(1) < 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If so, the results will be unstable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the seed is given, so result is still stable. |
||
|""".stripMargin) | ||
checkFiltersRemoved(df11) | ||
checkPushedInfo(df11, "PushedFilters: " + | ||
"[(GREATEST(BONUS, 1100.0)) > 1200.0, (LEAST(SALARY, 10000.00)) > 9000.00, RAND(1) < 1.0]") | ||
checkAnswer(df11, Row(2, "david", 10000, 1300, true)) | ||
|
||
val df12 = sql( | ||
""" | ||
|SELECT * FROM h2.test.employee | ||
|WHERE IF(SALARY > 10000, SALARY, LEAST(SALARY, 1000)) > 1200 | ||
|""".stripMargin) | ||
checkFiltersRemoved(df12) | ||
checkPushedInfo(df12, "PushedFilters: " + | ||
"[(CASE WHEN SALARY > 10000.00 THEN SALARY ELSE LEAST(SALARY, 1000.00) END) > 1200.00]") | ||
checkAnswer(df12, Seq(Row(2, "alex", 12000, 1200, false), Row(6, "jen", 12000, 1200, true))) | ||
} | ||
|
||
test("scan with filter push-down with ansi mode") { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's file a separate JIRA if it adds more supports of other stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK