[SPARK-16192][SQL] Add type checks in CollectSet#13892
Closed
maropu wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-16192][SQL] Add type checks in CollectSet#13892maropu wants to merge 3 commits intoapache:masterfrom
maropu wants to merge 3 commits intoapache:masterfrom
Conversation
|
Test build #61170 has finished for PR 13892 at commit
|
Member
Author
|
@cloud-fan Could you check this? |
Contributor
|
@maropu could you implement |
| failAnalysis(s"grouping_id() can only be used with GroupingSets/Cube/Rollup") | ||
| failAnalysis("grouping_id() can only be used with GroupingSets/Cube/Rollup") | ||
|
|
||
| case c: CollectSet if c.child.dataType.isInstanceOf[MapType] => |
Contributor
There was a problem hiding this comment.
This should be recursive. The child could be a struct/array containing a map.
Member
Author
There was a problem hiding this comment.
oh, my bad. I'll fix this.
| "another aggregate function." :: Nil) | ||
| } | ||
|
|
||
| test("we should fail analysis when we find map type data in collect_set") { |
|
Test build #61211 has finished for PR 13892 at commit
|
Contributor
|
LGTM - pending jenkins |
|
Test build #61212 has finished for PR 13892 at commit
|
|
Test build #61213 has finished for PR 13892 at commit
|
|
Test build #61216 has finished for PR 13892 at commit
|
|
Test build #61217 has finished for PR 13892 at commit
|
Contributor
|
Merging to master/2.0. Thanks! |
asfgit
pushed a commit
that referenced
this pull request
Jun 25, 2016
## What changes were proposed in this pull request? `CollectSet` cannot have map-typed data because MapTypeData does not implement `equals`. So, this pr is to add type checks in `CheckAnalysis`. ## How was this patch tested? Added tests to check failures when we found map-typed data in `CollectSet`. Author: Takeshi YAMAMURO <linguin.m.s@gmail.com> Closes #13892 from maropu/SPARK-16192. (cherry picked from commit d2e44d7) Signed-off-by: Herman van Hovell <hvanhovell@databricks.com>
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 free
to 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?
CollectSetcannot have map-typed data because MapTypeData does not implementequals.So, this pr is to add type checks in
CheckAnalysis.How was this patch tested?
Added tests to check failures when we found map-typed data in
CollectSet.