Skip to content

Conversation

@juliuszsompolski
Copy link
Contributor

What changes were proposed in this pull request?

Fix Decimal toScalaBigInt and toJavaBigInteger used to only work for decimals not fitting long.

How was this patch tested?

Added test to DecimalSuite.

@juliuszsompolski
Copy link
Contributor Author

cc @hvanhovell

Copy link
Contributor

@hvanhovell hvanhovell left a comment

Choose a reason for hiding this comment

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

LGTM - pending jenkins

@SparkQA
Copy link

SparkQA commented Nov 13, 2018

Test build #98772 has finished for PR 23022 at commit 9c52e09.

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

assert(decimal.toJavaBigDecimal.unscaledValue.toString === "9223372036854775808")
}

test("SPARK-26038: toScalaBigInt/toJavaBigInteger not fitting long") {
Copy link
Member

@MaxGekk MaxGekk Nov 13, 2018

Choose a reason for hiding this comment

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

Should we test the branch when decimalVal.ne(null) is false?

Copy link
Member

@MaxGekk MaxGekk Nov 13, 2018

Choose a reason for hiding this comment

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

I just re-run DecimalSuite in the debugger, and haven't hit breakpoints in the branches. It seems there are no tests for nulls at all.

@SparkQA
Copy link

SparkQA commented Nov 13, 2018

Test build #98781 has finished for PR 23022 at commit 4bdc82b.

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

@kiszk
Copy link
Member

kiszk commented Nov 23, 2018

LGTM

@juliuszsompolski
Copy link
Contributor Author

ping @hvanhovell

Copy link
Contributor

@hvanhovell hvanhovell left a comment

Choose a reason for hiding this comment

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

LGTM

@hvanhovell
Copy link
Contributor

Merging to master. Thank!

@asfgit asfgit closed this in ecb785f Nov 23, 2018
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
… fitting in long

## What changes were proposed in this pull request?

Fix Decimal `toScalaBigInt` and `toJavaBigInteger` used to only work for decimals not fitting long.

## How was this patch tested?

Added test to DecimalSuite.

Closes apache#23022 from juliuszsompolski/SPARK-26038.

Authored-by: Juliusz Sompolski <[email protected]>
Signed-off-by: Herman van Hovell <[email protected]>
JoshRosen pushed a commit to JoshRosen/spark that referenced this pull request Jun 21, 2019
… fitting in long

## What changes were proposed in this pull request?

Fix Decimal `toScalaBigInt` and `toJavaBigInteger` used to only work for decimals not fitting long.

## How was this patch tested?

Added test to DecimalSuite.

Closes apache#23022 from juliuszsompolski/SPARK-26038.

Authored-by: Juliusz Sompolski <[email protected]>
Signed-off-by: Herman van Hovell <[email protected]>
JoshRosen pushed a commit that referenced this pull request Jun 21, 2019
…decimals not fitting in long

This is a Spark 2.4.x backport of #23022. Original description follows below:

## What changes were proposed in this pull request?

Fix Decimal `toScalaBigInt` and `toJavaBigInteger` used to only work for decimals not fitting long.

## How was this patch tested?

Added test to DecimalSuite.

Closes #24928 from JoshRosen/joshrosen/SPARK-26038-backport.

Authored-by: Juliusz Sompolski <[email protected]>
Signed-off-by: Josh Rosen <[email protected]>
rluta pushed a commit to rluta/spark that referenced this pull request Sep 17, 2019
…decimals not fitting in long

This is a Spark 2.4.x backport of apache#23022. Original description follows below:

## What changes were proposed in this pull request?

Fix Decimal `toScalaBigInt` and `toJavaBigInteger` used to only work for decimals not fitting long.

## How was this patch tested?

Added test to DecimalSuite.

Closes apache#24928 from JoshRosen/joshrosen/SPARK-26038-backport.

Authored-by: Juliusz Sompolski <[email protected]>
Signed-off-by: Josh Rosen <[email protected]>
kai-chi pushed a commit to kai-chi/spark that referenced this pull request Sep 26, 2019
…decimals not fitting in long

This is a Spark 2.4.x backport of apache#23022. Original description follows below:

## What changes were proposed in this pull request?

Fix Decimal `toScalaBigInt` and `toJavaBigInteger` used to only work for decimals not fitting long.

## How was this patch tested?

Added test to DecimalSuite.

Closes apache#24928 from JoshRosen/joshrosen/SPARK-26038-backport.

Authored-by: Juliusz Sompolski <[email protected]>
Signed-off-by: Josh Rosen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants