-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-12904][SQL] Strength reduction for integral/decimal comparisons #10845
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
Conversation
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.
We add this rule in analyser instead of optimizer because DecimalPrecision and ImplicitTypeCasts rules in analyser will add additional Cast operator to the integer expression.
|
Test build #49772 has finished for PR 10845 at commit
|
|
Test build #49863 has finished for PR 10845 at commit
|
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.
this should apply for any integral type, not just integer. Also can you make this function shorter by breaking it into two functions? It is pretty long now.
|
Test build #49902 has finished for PR 10845 at commit
|
|
Test build #49906 has finished for PR 10845 at commit
|
|
retest this please. |
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 don't think you can just do a toInt here .... decimal scope is larger than int.
|
@viirya rather than me pointing out all the problem in each iteration, can you try figuring out all the corner cases yourself and then submit this for review? Thanks. |
|
Test build #49915 has finished for PR 10845 at commit
|
|
@rxin Sure. |
|
Test build #49918 has finished for PR 10845 at commit
|
JIRA: https://issues.apache.org/jira/browse/SPARK-12904
We can do the following strength reduction for comparisons between an integral column and a decimal literal: