-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-19727][SQL][followup] Fix for round function that modifies original column #19576
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 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 |
|---|---|---|
|
|
@@ -258,6 +258,18 @@ class MathFunctionsSuite extends QueryTest with SharedSQLContext { | |
| ) | ||
| } | ||
|
|
||
| test("round/bround with table columns") { | ||
|
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. This is an end-to-end test for code-gen path. Could we add a unit test case in
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. All the tests in |
||
| withTable("t") { | ||
| Seq(BigDecimal("5.9")).toDF("i").write.saveAsTable("t") | ||
| checkAnswer( | ||
| sql("select i, round(i) from t"), | ||
| Seq(Row(BigDecimal("5.9"), BigDecimal("6")))) | ||
| checkAnswer( | ||
| sql("select i, bround(i) from t"), | ||
| Seq(Row(BigDecimal("5.9"), BigDecimal("6")))) | ||
| } | ||
| } | ||
|
|
||
| test("exp") { | ||
| testOneToOneMathFunction(exp, math.exp) | ||
| } | ||
|
|
||
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.
Optionis hard to use in java code(the codegen path), so I change the return type to nullableDecimal.