Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed Jun 21, 2019
1 parent 37f47ef commit bc25c0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ object RowEncoder {
d,
"fromDecimal",
inputObject :: Nil,
returnNullable = false), d)
returnNullable = false), d, SQLConf.get.decimalOperationsNullOnOverflow)

case StringType => createSerializerForString(inputObject)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1446,8 +1446,8 @@ object SQLConf {
.internal()
.doc("When true (default), if an overflow on a decimal occurs, then NULL is returned. " +
"Spark's older versions and Hive behave in this way. If turned to false, SQL ANSI 2011 " +
"specification will be followed instead: an arithmetic is thrown, as most of the SQL " +
"databases do.")
"specification will be followed instead: an arithmetic exception is thrown, as most " +
"of the SQL databases do.")
.booleanConf
.createWithDefault(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DecimalExpressionSuite extends SparkFunSuite with ExpressionEvalHelper {
checkEvaluation(CheckOverflow(Literal(d1), DecimalType(4, 2), true), d1)
checkEvaluation(CheckOverflow(Literal(d1), DecimalType(4, 3), true), null)
intercept[ArithmeticException](CheckOverflow(Literal(d1), DecimalType(4, 3), false).eval())
intercept[ArithmeticException](checkEvaluationWithGeneratedMutableProjection(
intercept[ArithmeticException](checkEvaluationWithMutableProjection(
CheckOverflow(Literal(d1), DecimalType(4, 3), false), null))

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

checkEvaluation(CheckOverflow(
Expand Down

0 comments on commit bc25c0d

Please sign in to comment.