Skip to content

Conversation

@cloud-fan
Copy link
Contributor

What changes were proposed in this pull request?

This is a followup of #17075 , to fix the bug in codegen path.

How was this patch tested?

new regression test

@cloud-fan
Copy link
Contributor Author

cc @wojtek-szymanski @hvanhovell

precision: Int,
scale: Int,
roundMode: BigDecimal.RoundingMode.Value = ROUND_HALF_UP): Option[Decimal] = {
roundMode: BigDecimal.RoundingMode.Value = ROUND_HALF_UP): Decimal = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Option is hard to use in java code(the codegen path), so I change the return type to nullable Decimal.

@SparkQA
Copy link

SparkQA commented Oct 26, 2017

Test build #83059 has finished for PR 19576 at commit cba65d1.

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

/**
* Create new `Decimal` with precision and scale given in `decimalType` (if any),
* returning null if it overflows or creating a new `value` and returning it if successful.
*
Copy link
Member

Choose a reason for hiding this comment

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

Nit: remove this useless line.

)
}

test("round/bround with table columns") {
Copy link
Member

Choose a reason for hiding this comment

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

This is an end-to-end test for code-gen path. Could we add a unit test case in MathExpressionsSuite?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the tests in MathExpressionsSuite are testing about literals, I think it's better to improve MathExpressionsSuite for attributes in a new PR, instead of doing it in a folllow-up PR. BTW the original PR didn't add test in MathExpressionsSuite either.

@gatorsmile
Copy link
Member

LGTM

@SparkQA
Copy link

SparkQA commented Oct 29, 2017

Test build #83176 has finished for PR 19576 at commit 2fe8eda.

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

@gatorsmile
Copy link
Member

Thanks! Merged to master/2.2

asfgit pushed a commit that referenced this pull request Oct 29, 2017
…ginal column

## What changes were proposed in this pull request?

This is a followup of #17075 , to fix the bug in codegen path.

## How was this patch tested?

new regression test

Author: Wenchen Fan <[email protected]>

Closes #19576 from cloud-fan/bug.

(cherry picked from commit 7fdacbc)
Signed-off-by: gatorsmile <[email protected]>
@asfgit asfgit closed this in 7fdacbc Oct 29, 2017
MatthewRBruce pushed a commit to Shopify/spark that referenced this pull request Jul 31, 2018
…ginal column

## What changes were proposed in this pull request?

This is a followup of apache#17075 , to fix the bug in codegen path.

## How was this patch tested?

new regression test

Author: Wenchen Fan <[email protected]>

Closes apache#19576 from cloud-fan/bug.

(cherry picked from commit 7fdacbc)
Signed-off-by: gatorsmile <[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.

3 participants