Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonwang-db committed Oct 28, 2021
1 parent 4a94ab1 commit 6d090f4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ abstract class BinaryArithmetic extends BinaryOperator with NullIntolerant {
assert(exactMathMethod.isDefined,
s"The expression '$nodeName' must override the exactMathMethod() method " +
"if it is supposed to operate over interval types.")
val mathClass = classOf[Math].getName
defineCodeGen(ctx, ev, (eval1, eval2) => s"$mathClass.${exactMathMethod.get}($eval1, $eval2)")
val mathUtils = MathUtils.getClass.getCanonicalName.stripSuffix("$")
defineCodeGen(ctx, ev, (eval1, eval2) => s"$mathUtils.${exactMathMethod.get}($eval1, $eval2)")
// byte and short are casted into int when add, minus, times or divide
case ByteType | ShortType =>
nullSafeCodeGen(ctx, ev, (eval1, eval2) => {
Expand All @@ -269,8 +269,8 @@ abstract class BinaryArithmetic extends BinaryOperator with NullIntolerant {
case IntegerType | LongType =>
nullSafeCodeGen(ctx, ev, (eval1, eval2) => {
val operation = if (failOnError && exactMathMethod.isDefined) {
val mathClass = classOf[Math].getName
s"$mathClass.${exactMathMethod.get}($eval1, $eval2)"
val mathUtils = MathUtils.getClass.getCanonicalName.stripSuffix("$")
s"$mathUtils.${exactMathMethod.get}($eval1, $eval2)"
} else {
s"$eval1 $symbol $eval2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ SELECT '' AS five, i.f1, i.f1 * smallint('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -220,7 +220,7 @@ SELECT '' AS five, i.f1, i.f1 * int('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -240,7 +240,7 @@ SELECT '' AS five, i.f1, i.f1 + smallint('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -261,7 +261,7 @@ SELECT '' AS five, i.f1, i.f1 + int('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -282,7 +282,7 @@ SELECT '' AS five, i.f1, i.f1 - smallint('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -303,7 +303,7 @@ SELECT '' AS five, i.f1, i.f1 - int('2') AS x FROM INT4_TBL i
struct<>
-- !query output
java.lang.ArithmeticException
integer overflow
integer overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL
struct<>
-- !query output
java.lang.ArithmeticException
long overflow
long overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ from range(9223372036854775804, 9223372036854775807) x
struct<>
-- !query output
java.lang.ArithmeticException
long overflow
long overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand All @@ -235,7 +235,7 @@ from range(-9223372036854775806, -9223372036854775805) x
struct<>
-- !query output
java.lang.ArithmeticException
long overflow
long overflow. You can set spark.sql.ansi.enabled to false (except for ANSI interval type) to bypass this error.


-- !query
Expand Down

0 comments on commit 6d090f4

Please sign in to comment.