Skip to content

Conversation

@ivoson
Copy link
Contributor

@ivoson ivoson commented May 31, 2021

What changes were proposed in this pull request?

Handle Currying Product while serializing TreeNode to JSON. While processing Product, we may get an assert error for cases like Currying Product because of the mismatch of sizes between field name and field values.
Fallback to use reflection to get all the values for constructor parameters when we meet such cases.

Why are the changes needed?

Avoid throwing error while serializing TreeNode to JSON, try to output as much information as possible.

Does this PR introduce any user-facing change?

No

How was this patch tested?

New UT case added.

@github-actions github-actions bot added the SQL label May 31, 2021
@ivoson
Copy link
Contributor Author

ivoson commented May 31, 2021

Hit a failed UT which would handle CachedRDDBuilder after backporting #32557 to spark 2.4.
Have not came up with any cases in Spark 3, this is just in case. cc @cloud-fan

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.1!

@cloud-fan cloud-fan closed this in 1603775 May 31, 2021
cloud-fan pushed a commit that referenced this pull request May 31, 2021
…g TreeNode to JSON

### What changes were proposed in this pull request?
Handle Currying Product while serializing TreeNode to JSON. While processing [Product](https://github.com/apache/spark/blob/v3.1.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L820), we may get an assert error for cases like Currying Product because of the mismatch of sizes between field name and field values.
Fallback to use reflection to get all the values for constructor parameters when we  meet such cases.

### Why are the changes needed?
Avoid throwing error while serializing TreeNode to JSON, try to output as much information as possible.

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

### How was this patch tested?
New UT case added.

Closes #32713 from ivoson/SPARK-35411-followup.

Authored-by: Tengfei Huang <tengfei.h@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@ivoson
Copy link
Contributor Author

ivoson commented May 31, 2021

Thanks for reviewing. @cloud-fan

@ivoson ivoson deleted the SPARK-35411-followup branch May 31, 2021 14:47
flyrain pushed a commit to flyrain/spark that referenced this pull request Sep 21, 2021
…g TreeNode to JSON

### What changes were proposed in this pull request?
Handle Currying Product while serializing TreeNode to JSON. While processing [Product](https://github.com/apache/spark/blob/v3.1.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L820), we may get an assert error for cases like Currying Product because of the mismatch of sizes between field name and field values.
Fallback to use reflection to get all the values for constructor parameters when we  meet such cases.

### Why are the changes needed?
Avoid throwing error while serializing TreeNode to JSON, try to output as much information as possible.

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

### How was this patch tested?
New UT case added.

Closes apache#32713 from ivoson/SPARK-35411-followup.

Authored-by: Tengfei Huang <tengfei.h@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
fishcus pushed a commit to fishcus/spark that referenced this pull request Jan 12, 2022
…g TreeNode to JSON

### What changes were proposed in this pull request?
Handle Currying Product while serializing TreeNode to JSON. While processing [Product](https://github.com/apache/spark/blob/v3.1.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L820), we may get an assert error for cases like Currying Product because of the mismatch of sizes between field name and field values.
Fallback to use reflection to get all the values for constructor parameters when we  meet such cases.

### Why are the changes needed?
Avoid throwing error while serializing TreeNode to JSON, try to output as much information as possible.

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

### How was this patch tested?
New UT case added.

Closes apache#32713 from ivoson/SPARK-35411-followup.

Authored-by: Tengfei Huang <tengfei.h@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
otterc pushed a commit to linkedin/spark that referenced this pull request Mar 22, 2023
…g TreeNode to JSON

Handle Currying Product while serializing TreeNode to JSON. While processing [Product](https://github.com/apache/spark/blob/v3.1.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala#L820), we may get an assert error for cases like Currying Product because of the mismatch of sizes between field name and field values.
Fallback to use reflection to get all the values for constructor parameters when we  meet such cases.

Avoid throwing error while serializing TreeNode to JSON, try to output as much information as possible.

No

New UT case added.

Closes apache#32713 from ivoson/SPARK-35411-followup.

Authored-by: Tengfei Huang <tengfei.h@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit ea7016f)

RB=3333473
BUG=LIHADOOP-63952
G=spark-reviewers
R=ekrogen,tgudivad
A=ekrogen,tgudivad
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.

3 participants