-
- Downloads
[SPARK-20665][SQL] Bround" and "Round" function return NULL
## What changes were proposed in this pull request? spark-sql>select bround(12.3, 2); spark-sql>NULL For this case, the expected result is 12.3, but it is null. So ,when the second parameter is bigger than "decimal.scala", the result is not we expected. "round" function has the same problem. This PR can solve the problem for both of them. ## How was this patch tested? unit test cases in MathExpressionsSuite and MathFunctionsSuite Author: liuxian <liu.xian3@zte.com.cn> Closes #17906 from 10110346/wip_lx_0509.
Showing
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala 6 additions, 6 deletions...ache/spark/sql/catalyst/expressions/mathExpressions.scala
- sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathExpressionsSuite.scala 3 additions, 4 deletions...spark/sql/catalyst/expressions/MathExpressionsSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala 13 additions, 0 deletions.../test/scala/org/apache/spark/sql/MathFunctionsSuite.scala
Please register or sign in to comment