Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[SPARK-39060][SQL] Typo in error messages of decimal overflow
This PR removes extra curly bracket from debug string for Decimal type in SQL.

Typo in error messages of decimal overflow.

No.

By running updated test:
```
$ build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z decimalArithmeticOperations.sql"
```

Closes #36397 from vli-databricks/SPARK-39060.

Authored-by: Vitalii Li <[email protected]>
Signed-off-by: Max Gekk <[email protected]>
  • Loading branch information
vitaliili-db committed May 5, 2022
commit bd0191fa6503a0f2fc5cd6daa5b71acb87a98d1a
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down