-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-17075][SQL][followup] fix some minor issues and clean up the code #17065
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
|
Test build #73465 has started for PR 17065 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.
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 shows that it is difficult to always over-estimate. How about we do not handle the nested NOT.
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.
SGTM
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.
@cloud-fan @ron8hu I'm a little confused about this, for Not expression, it always becomes under-estimation if we do over-estimation, no matter it's nested or not. So should we remove support for nested Not or Not?
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.
also support EqualNullSafe
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.
previously we totally missed BooleanType and will throw MatchError if the attribute is bool. But the logic in evaluateBinaryForNumeric doesn't work for boolean, so I treat it as unsupported for now. @wzhfy do you have time to work on it?
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.
@ron8hu the external value type of DecimalType is java decimal, and the internal value type is Decimal, we need to convert it.
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.
Agreed. Thanks for fixing it.
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.
added boolean type
|
Test build #73466 has started for PR 17065 at commit |
|
retest this please |
|
Test build #73471 has finished for PR 17065 at commit
|
ron8hu
left a comment
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.
LGTM. Yesterday I started making changes based on your feedback. My effort was delayed by a build error after I fetched the latest code from master repository yesterday. Today I reviewed your follow-up PR. Your changes are a super set of mine. Pretty good and clean code! I will stop my code changes on this jira. Thanks for your follow-up effort.
| case _: NumericType | BooleanType | DateType | TimestampType => | ||
| val statsRange = Range(colStat.min, colStat.max, dataType).asInstanceOf[NumericRange] | ||
| val validQuerySet = hSet.filter { v => | ||
| v != null && statsRange.contains(Literal(v, dataType)) |
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.
nit: for better readability: (v != null) && statsRange.contains(Literal(v, dataType))
|
thanks for the review, merging to master! |
|
@ron8hu can you fix #17065 (comment) and #17065 (comment) if you have time? thanks! |
## What changes were proposed in this pull request? This is a follow-up of apache#16395. It fixes some code style issues, naming issues, some missing cases in pattern match, etc. ## How was this patch tested? existing tests. Author: Wenchen Fan <[email protected]> Closes apache#17065 from cloud-fan/follow-up.
|
@cloud-fan @ron8hu Let me submit a follow-up pr to fix the remaining issues. |
What changes were proposed in this pull request?
This is a follow-up of #16395. It fixes some code style issues, naming issues, some missing cases in pattern match, etc.
How was this patch tested?
existing tests.