-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32808][SQL] Fix some test cases of sql/core module in scala 2.13
#29660
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
Changes from 4 commits
6171535
990d75c
51238d6
1fa24b9
454b53c
9185a95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -478,15 +478,15 @@ final class Decimal extends Ordered[Decimal] with Serializable { | |
| if (decimalVal.eq(null) && that.decimalVal.eq(null) && scale == that.scale) { | ||
| Decimal(longVal + that.longVal, Math.max(precision, that.precision), scale) | ||
| } else { | ||
| Decimal(toBigDecimal + that.toBigDecimal) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Scala 2.13, and in Scala 2.12 There are some differences in accuracy.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we want to set a MathContext here anyway?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean we need change to use methods with MathContext ? Like
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry , I think I don't fully understand this comments ....
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the change is OK here, because we actually do not want to modify the rounding, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right ~ |
||
| Decimal(toBigDecimal.bigDecimal.add(that.toBigDecimal.bigDecimal)) | ||
| } | ||
| } | ||
|
|
||
| def - (that: Decimal): Decimal = { | ||
| if (decimalVal.eq(null) && that.decimalVal.eq(null) && scale == that.scale) { | ||
| Decimal(longVal - that.longVal, Math.max(precision, that.precision), scale) | ||
| } else { | ||
| Decimal(toBigDecimal - that.toBigDecimal) | ||
| Decimal(toBigDecimal.bigDecimal.subtract(that.toBigDecimal.bigDecimal)) | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entrance is
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/ArrayData.scala
Lines 28 to 38 in 04f7f6d
not easy to call
toSeq, so I changed it here