Skip to content

Commit bc25c0d

Browse files
committed
fix compilation error
1 parent 37f47ef commit bc25c0d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/RowEncoder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object RowEncoder {
114114
d,
115115
"fromDecimal",
116116
inputObject :: Nil,
117-
returnNullable = false), d)
117+
returnNullable = false), d, SQLConf.get.decimalOperationsNullOnOverflow)
118118

119119
case StringType => createSerializerForString(inputObject)
120120

sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,8 +1446,8 @@ object SQLConf {
14461446
.internal()
14471447
.doc("When true (default), if an overflow on a decimal occurs, then NULL is returned. " +
14481448
"Spark's older versions and Hive behave in this way. If turned to false, SQL ANSI 2011 " +
1449-
"specification will be followed instead: an arithmetic is thrown, as most of the SQL " +
1450-
"databases do.")
1449+
"specification will be followed instead: an arithmetic exception is thrown, as most " +
1450+
"of the SQL databases do.")
14511451
.booleanConf
14521452
.createWithDefault(true)
14531453

sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DecimalExpressionSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DecimalExpressionSuite extends SparkFunSuite with ExpressionEvalHelper {
5050
checkEvaluation(CheckOverflow(Literal(d1), DecimalType(4, 2), true), d1)
5151
checkEvaluation(CheckOverflow(Literal(d1), DecimalType(4, 3), true), null)
5252
intercept[ArithmeticException](CheckOverflow(Literal(d1), DecimalType(4, 3), false).eval())
53-
intercept[ArithmeticException](checkEvaluationWithGeneratedMutableProjection(
53+
intercept[ArithmeticException](checkEvaluationWithMutableProjection(
5454
CheckOverflow(Literal(d1), DecimalType(4, 3), false), null))
5555

5656
val d2 = Decimal(101, 3, 1)
@@ -59,7 +59,7 @@ class DecimalExpressionSuite extends SparkFunSuite with ExpressionEvalHelper {
5959
checkEvaluation(CheckOverflow(Literal(d2), DecimalType(4, 2), true), d2)
6060
checkEvaluation(CheckOverflow(Literal(d2), DecimalType(4, 3), true), null)
6161
intercept[ArithmeticException](CheckOverflow(Literal(d2), DecimalType(4, 3), false).eval())
62-
intercept[ArithmeticException](checkEvaluationWithGeneratedMutableProjection(
62+
intercept[ArithmeticException](checkEvaluationWithMutableProjection(
6363
CheckOverflow(Literal(d2), DecimalType(4, 3), false), null))
6464

6565
checkEvaluation(CheckOverflow(

0 commit comments

Comments
 (0)