-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-20665][SQL]"Bround" and "Round" function return NULL #17906
Changes from all commits
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 |
---|---|---|
|
@@ -231,6 +231,19 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext { | |
Seq(Row(BigDecimal("0E3"), BigDecimal("0E2"), BigDecimal("0E1"), BigDecimal(3), | ||
BigDecimal("3.1"), BigDecimal("3.14"), BigDecimal("3.142"))) | ||
) | ||
|
||
val bdPi: BigDecimal = BigDecimal(31415925L, 7) | ||
checkAnswer( | ||
sql(s"SELECT round($bdPi, 7), round($bdPi, 8), round($bdPi, 9), round($bdPi, 10), " + | ||
s"round($bdPi, 100), round($bdPi, 6), round(null, 8)"), | ||
Seq(Row(bdPi, bdPi, bdPi, bdPi, bdPi, BigDecimal("3.141593"), null)) | ||
) | ||
|
||
checkAnswer( | ||
sql(s"SELECT bround($bdPi, 7), bround($bdPi, 8), bround($bdPi, 9), bround($bdPi, 10), " + | ||
s"bround($bdPi, 100), bround($bdPi, 6), bround(null, 8)"), | ||
Seq(Row(bdPi, bdPi, bdPi, bdPi, bdPi, BigDecimal("3.141592"), null)) | ||
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. How about moving the test case to
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. we can do it in a follow-up |
||
) | ||
} | ||
|
||
test("round/bround with data frame from a local Seq of Product") { | ||
|
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.
seems we are changing the behavior, can you check with other database and see if it's expected to return the original value for this case?