Uh oh!
There was an error while loading. Please reload this page.
[SPARK-19716][SQL] support by-name resolution for struct type elements in array - #17398
Closed
cloud-fan wants to merge 3 commits into
Closed
[SPARK-19716][SQL] support by-name resolution for struct type elements in array#17398cloud-fan wants to merge 3 commits into
cloud-fan wants to merge 3 commits into
Conversation
cloud-fan
commented
Mar 23, 2017
ContributorAuthor
cloud-fan
commented
Mar 23, 2017
ContributorAuthor
There was a problem hiding this comment.
we should not serialize an unresolved encoder, so I make it transient here
SparkQA
commented
Mar 23, 2017
Test build #75096 has finished for PR 17398 at commit
|
Contributor
There was a problem hiding this comment.
Is there a reason we don't have any encodeDecodeTest?
ContributorAuthor
There was a problem hiding this comment.
encodeDecodeTest is a round trip test so that the type and schema match exactly. I added an end-to-end test in DatasetSuite
SparkQA
commented
Mar 25, 2017
Test build #75216 has finished for PR 17398 at commit
|
cloud-fan
commented
Mar 28, 2017
| (s"""${classOf[Builder[_, _]].getName} $builderValue = $getBuilderVar; | ||
| $builderValue.sizeHint($dataLength);""", | ||
| ( | ||
| s""" |
ContributorAuthor
There was a problem hiding this comment.
below are style-only changes
SparkQA
commented
Mar 28, 2017
Test build #75317 has finished for PR 17398 at commit
|
liancheng
commented
Apr 4, 2017
Contributor
LGTM. Merging to master. Thanks! |
asfgit pushed a commit
that referenced
this pull request
Apr 16, 2017
…erializable ## What changes were proposed in this pull request? In #17398 we introduced `UnresolvedMapObjects` as a placeholder of `MapObjects`. Unfortunately `UnresolvedMapObjects` is not serializable as its `function` may reference Scala `Type` which is not serializable. Ideally this is fine, as we will never serialize and send unresolved expressions to executors. However users may accidentally do this, e.g. mistakenly reference an encoder instance when implementing `Aggregator`, we should fix it so that it's just a performance issue(more network traffic) and should not fail the query. ## How was this patch tested? N/A Author: Wenchen Fan <wenchen@databricks.com> Closes#17639 from cloud-fan/minor.
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?
Previously when we construct deserializer expression for array type, we will first cast the corresponding field to expected array type and then apply
MapObjects.However, by doing that, we lose the opportunity to do by-name resolution for struct type inside array type. In this PR, I introduce a
UnresolvedMapObjectsto hold the lambda function and the input array expression. Then during analysis, after the input array expression is resolved, we get the actual array element type and apply by-name resolution. Then we don't need to addCastfor array type when constructing the deserializer expression, as the element type is determined later at analyzer.How was this patch tested?
new regression test