Uh oh!
There was an error while loading. Please reload this page.
[SPARK-22384][SQL][followup] Refine partition pruning when attribute is wrapped in Cast - #21712
Closed
cloud-fan wants to merge 2 commits into
Closed
[SPARK-22384][SQL][followup] Refine partition pruning when attribute is wrapped in Cast#21712cloud-fan wants to merge 2 commits into
cloud-fan wants to merge 2 commits into
Conversation
cloud-fan
commented
Jul 4, 2018
ContributorAuthor
viirya
reviewed
Jul 4, 2018
| "aa" :: "ab" :: "ba" :: "bb" :: Nil) | ||
| } | ||
| test("getPartitionsByFilter: cast(chunk as boolean)=1 (not a valid partition predicate)") { |
viirya
reviewed
Jul 4, 2018
| * Returns true iff we can safely cast the `from` type to `to` type without any truncating or | ||
| * precision lose, e.g. int -> long, date -> timestamp. | ||
| */ | ||
| def canSafeCast(from: AtomicType, to: AtomicType): Boolean = (from, to) match { |
ContributorAuthor
There was a problem hiding this comment.
yes, at least for now. Hive partition predicate doesn't support complex type.
viirya
reviewed
Jul 4, 2018
| "aa" :: Nil) | ||
| } | ||
| test("getPartitionsByFilter: cast(chunk as int)=1 (not a valid partition predicate)") { |
Member
There was a problem hiding this comment.
I ran this test with current master branch, seems it can also pass without this change?
ContributorAuthor
There was a problem hiding this comment.
yes this can pass, we can tell it by #12586
Cast.mayTruncate returns true for string to int, but not string to boolean. Here I just wanna test both of the cases, to improve test coverage.
SparkQA
commented
Jul 4, 2018
Test build #92602 has finished for PR 21712 at commit
|
SparkQA
commented
Jul 4, 2018
Test build #92608 has finished for PR 21712 at commit
|
gatorsmile
commented
Jul 5, 2018
Member
Thanks! Merged to master. |
jinxing64
commented
Jul 5, 2018
Thanks for ping me. LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
As mentioned in #21586 ,
Cast.mayTruncateis not 100% safe, string to boolean is allowed. Since changingCast.mayTruncatealso changes the behavior of Dataset, here I propose to add a newCast.canSafeCastfor partition pruning.How was this patch tested?
new test cases