This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new 6f9e3034ada [SPARK-39060][SQL][3.2] Typo in error messages of decimal 
overflow
6f9e3034ada is described below

commit 6f9e3034ada72f372dafe93152e01ad5cb323989
Author: Vitalii Li <vitalii...@databricks.com>
AuthorDate: Thu May 12 08:13:51 2022 +0300

    [SPARK-39060][SQL][3.2] Typo in error messages of decimal overflow
    
    ### What changes were proposed in this pull request?
    
    This PR removes extra curly bracket from debug string for Decimal type in 
SQL.
    
    This is a backport from master branch. Commit: 
https://github.com/apache/spark/commit/165ce4eb7d6d75201beb1bff879efa99fde24f94
    
    ### Why are the changes needed?
    
    Typo in error messages of decimal overflow.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    By running tests:
    ```
    $ build/sbt "sql/testOnly"
    ```
    
    Closes #36458 from vli-databricks/SPARK-39060-3.2.
    
    Authored-by: Vitalii Li <vitalii...@databricks.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 .../src/main/scala/org/apache/spark/sql/types/Decimal.scala       | 4 ++--
 .../sql-tests/results/ansi/decimalArithmeticOperations.sql.out    | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
index 46814297231..bc5fba8d0d8 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/types/Decimal.scala
@@ -227,9 +227,9 @@ final class Decimal extends Ordered[Decimal] with 
Serializable {
 
   def toDebugString: String = {
     if (decimalVal.ne(null)) {
-      s"Decimal(expanded,$decimalVal,$precision,$scale})"
+      s"Decimal(expanded, $decimalVal, $precision, $scale)"
     } else {
-      s"Decimal(compact,$longVal,$precision,$scale})"
+      s"Decimal(compact, $longVal, $precision, $scale)"
     }
   }
 
diff --git 
a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
 
b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
index 2f3513e734f..c65742e4d8b 100644
--- 
a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
+++ 
b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out
@@ -76,7 +76,7 @@ select (5e36BD + 0.1) + 5e36BD
 struct<>
 -- !query output
 java.lang.ArithmeticException
-Decimal(expanded,10000000000000000000000000000000000000.1,39,1}) cannot be 
represented as Decimal(38, 1).
+Decimal(expanded, 10000000000000000000000000000000000000.1, 39, 1) cannot be 
represented as Decimal(38, 1).
 
 
 -- !query
@@ -85,7 +85,7 @@ select (-4e36BD - 0.1) - 7e36BD
 struct<>
 -- !query output
 java.lang.ArithmeticException
-Decimal(expanded,-11000000000000000000000000000000000000.1,39,1}) cannot be 
represented as Decimal(38, 1).
+Decimal(expanded, -11000000000000000000000000000000000000.1, 39, 1) cannot be 
represented as Decimal(38, 1).
 
 
 -- !query
@@ -94,7 +94,7 @@ select 12345678901234567890.0 * 12345678901234567890.0
 struct<>
 -- !query output
 java.lang.ArithmeticException
-Decimal(expanded,152415787532388367501905199875019052100,39,0}) cannot be 
represented as Decimal(38, 2).
+Decimal(expanded, 152415787532388367501905199875019052100, 39, 0) cannot be 
represented as Decimal(38, 2).
 
 
 -- !query
@@ -103,7 +103,7 @@ select 1e35BD / 0.1
 struct<>
 -- !query output
 java.lang.ArithmeticException
-Decimal(expanded,1000000000000000000000000000000000000,37,0}) cannot be 
represented as Decimal(38, 6).
+Decimal(expanded, 1000000000000000000000000000000000000, 37, 0) cannot be 
represented as Decimal(38, 6).
 
 
 -- !query


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to