-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-31958][SQL] normalize special floating numbers in subquery #28785
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
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 |
|---|---|---|
|
|
@@ -56,10 +56,6 @@ import org.apache.spark.sql.types._ | |
| object NormalizeFloatingNumbers extends Rule[LogicalPlan] { | ||
|
|
||
| def apply(plan: LogicalPlan): LogicalPlan = plan match { | ||
| // A subquery will be rewritten into join later, and will go through this rule | ||
| // eventually. Here we skip subquery, as we only need to run this rule once. | ||
| case _: Subquery => plan | ||
|
Member
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. How about adding tests for the subquery case in
Contributor
Author
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. No we can't. This fix relies on the rule |
||
|
|
||
| case _ => plan transform { | ||
| case w: Window if w.partitionSpec.exists(p => needNormalize(p)) => | ||
| // Although the `windowExpressions` may refer to `partitionSpec` expressions, we don't need | ||
|
|
||
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.
Does it also mean
This batch must be executed after theRewriteSubquerybatch, which creates joins.is not definitely true now?Uh oh!
There was an error while loading. Please reload this page.
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.
it's still true, the correlated subquery becomes join, and may have new join keys.
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.
I see. Makes sense.