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

[3.0][SQL] Revert SPARK-32018 #29450

Closed

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

Revert SPARK-32018 related changes in branch 3.0: #29125 and #29404

Why are the changes needed?

#29404 is made to fix correctness regression introduced by #29125. However, the behavior of decimal overflow is strange in non-ansi mode:

  1. from 3.0.0 to 3.0.1: decimal overflow will throw exceptions instead of returning null on decimal overflow
  2. from 3.0.1 to 3.1.0: decimal overflow will return null instead of throwing exceptions.

So, this PR proposes to revert both #29404 and #29125. So that Spark will return null on decimal overflow in Spark 3.0.0 and Spark 3.0.1.

Does this PR introduce any user-facing change?

Yes, Spark will return null on decimal overflow in Spark 3.0.1.

How was this patch tested?

Unit tests

@gengliangwang gengliangwang changed the title [3.0] Revert SPARK-32018 [3.0][SQL] Revert SPARK-32018 Aug 17, 2020
@SparkQA
Copy link

SparkQA commented Aug 17, 2020

Test build #127501 has finished for PR 29450 at commit 37ad74b.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@cloud-fan
Copy link
Contributor

+1 to revert to unblock 3.0.1, also see my comment in #29448 (comment)

@SparkQA
Copy link

SparkQA commented Aug 17, 2020

Test build #127504 has finished for PR 29450 at commit 37ad74b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

I'm merging it first as it's safer to revert and keep the behavior the same as before. We can re-try to fix it if we have better ideas.

@cloud-fan cloud-fan closed this Aug 17, 2020
cloud-fan pushed a commit that referenced this pull request Aug 17, 2020
### What changes were proposed in this pull request?

Revert SPARK-32018 related changes in branch 3.0: #29125 and  #29404

### Why are the changes needed?

#29404 is made to fix correctness regression introduced by #29125. However, the behavior of decimal overflow is strange in non-ansi mode:
1. from 3.0.0 to 3.0.1: decimal overflow will throw exceptions instead of returning null on decimal overflow
2. from 3.0.1 to 3.1.0: decimal overflow will return null instead of throwing exceptions.

So, this PR proposes to revert both #29404 and #29125. So that Spark will return null on decimal overflow in Spark 3.0.0 and Spark 3.0.1.

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

Yes, Spark will return null on decimal overflow in Spark 3.0.1.

### How was this patch tested?

Unit tests

Closes #29450 from gengliangwang/revertDecimalOverflow.

Authored-by: Gengliang Wang <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
@dongjoon-hyun
Copy link
Member

+1 for the reasoning. Thank you for the decision, @cloud-fan .

@viirya
Copy link
Member

viirya commented Aug 17, 2020

looks good.

@maropu
Copy link
Member

maropu commented Aug 17, 2020

Is it worth describing the current behaviour #29448 (comment) as a known issue in the v3.0.1 release note?

@gengliangwang
Copy link
Member Author

@maropu This is a long-standing issue in Spark. I think we can mention the latest behavior in the migration guide and release note of 3.1.0.

gengliangwang added a commit that referenced this pull request Aug 19, 2020
…erflow in sum aggregation

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

Add migration guide for decimal value overflow behavior in sum aggregation, introduced in #29026

### Why are the changes needed?

Add migration guide for the behavior changes from 3.0 to 3.1.
See also: #29450 (comment)

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

No

### How was this patch tested?

Build docs and preview:
![image](https://user-images.githubusercontent.com/1097932/90589256-8b7e3380-e192-11ea-8ff1-05a447c20722.png)

Closes #29458 from gengliangwang/migrationGuideDecimalOverflow.

Authored-by: Gengliang Wang <[email protected]>
Signed-off-by: Gengliang Wang <[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.

7 participants