Skip to content
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

[SPARK-34749][SQL] Simplify ResolveCreateNamedStruct #31843

Closed
wants to merge 2 commits into from

Conversation

cloud-fan
Copy link
Contributor

@cloud-fan cloud-fan commented Mar 15, 2021

What changes were proposed in this pull request?

This is a follow-up of #31808 and simplifies its fix to one line (excluding comments).

Why are the changes needed?

code simplification

Does this PR introduce any user-facing change?

no

How was this patch tested?

N/A

@cloud-fan
Copy link
Contributor Author

cc @dongjoon-hyun @maropu

@github-actions github-actions bot added the SQL label Mar 15, 2021
@SparkQA
Copy link

SparkQA commented Mar 15, 2021

Test build #136078 has finished for PR 31843 at commit 52846d4.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

Could you fix the relevant UT failure?

[info] - dereference *** FAILED *** (335 milliseconds)
[info]   == FAIL: Plans do not match ===
[info]   !'Filter struct(a, 'a, b, 'b)[b]   'Filter named_struct(NamePlaceholder, 'a, NamePlaceholder, 'b)[b]
[info]    +- OneRowRelation                 +- OneRowRelation (PlanTest.scala:161)

@cloud-fan
Copy link
Contributor Author

The scala 2.13 failure is unrelated. Can you take another look? @dongjoon-hyun @maropu , thanks!

@LuciferYang
Copy link
Contributor

The scala 2.13 failure is unrelated. Can you take another look? @dongjoon-hyun @maropu , thanks!

#31862 seems can fix this.

// 4. GetMapValue if `a.b` refers to a map-type column.
// We should always use the last part of the column name (`c` in the above example) as the
// alias name inside CreateNamedStruct.
case (u: UnresolvedAttribute, _) => Seq(Literal(u.nameParts.last), u)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. This change makes ResolveCreateNamedStruct simpler. The fix seems smart.

@maropu maropu changed the title [SPARK-34749][SQL] Simplify CreateNamedStruct [SPARK-34749][SQL] Simplify ResolveCreateNamedStruct Mar 17, 2021
@maropu maropu closed this in bf4570b Mar 17, 2021
@maropu
Copy link
Member

maropu commented Mar 17, 2021

Thanks! Merged to master.

@maropu
Copy link
Member

maropu commented Mar 17, 2021

The commit has a conflict with branch-3.1. Is it better to merge this in branch-3.1, too, because this is a follow-up of #31808? If so, could you open a backport PR for the fix?

cloud-fan added a commit to cloud-fan/spark that referenced this pull request Mar 17, 2021
This is a follow-up of apache#31808 and simplifies its fix to one line (excluding comments).

code simplification

no

N/A

Closes apache#31843 from cloud-fan/simplify.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
maropu pushed a commit that referenced this pull request Mar 17, 2021
backports #31843

### What changes were proposed in this pull request?

This is a follow-up of #31808 and simplifies its fix to one line (excluding comments).

### Why are the changes needed?

code simplification

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

Closes #31867 from cloud-fan/backport.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
backports apache#31843

### What changes were proposed in this pull request?

This is a follow-up of apache#31808 and simplifies its fix to one line (excluding comments).

### Why are the changes needed?

code simplification

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

Closes apache#31867 from cloud-fan/backport.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
fishcus pushed a commit to fishcus/spark that referenced this pull request Jan 12, 2022
backports apache#31843

### What changes were proposed in this pull request?

This is a follow-up of apache#31808 and simplifies its fix to one line (excluding comments).

### Why are the changes needed?

code simplification

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

Closes apache#31867 from cloud-fan/backport.

Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Takeshi Yamamuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants