Skip to content

Commit

Permalink
Spark32X: hotfix for ABS on Decmial128 (#4177)
Browse files Browse the repository at this point in the history
Signed-off-by: sperlingxx <lovedreamf@gmail.com>
  • Loading branch information
sperlingxx authored Nov 22, 2021
1 parent b6f8d89 commit 0fdb1cb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ abstract class SparkBaseShims extends Spark30XShims with Logging {
GpuOverrides.expr[Abs](
"Absolute value",
ExprChecks.unaryProjectAndAstInputMatchesOutput(
TypeSig.implicitCastsAstTypes, TypeSig.gpuNumeric + TypeSig.DECIMAL_128_FULL,
TypeSig.numeric),
TypeSig.implicitCastsAstTypes, TypeSig.numeric, TypeSig.numeric),
(a, conf, p, r) => new UnaryAstExprMeta[Abs](a, conf, p, r) {
// ANSI support for ABS was added in 3.2.0 SPARK-33275
override def convertToGpu(child: Expression): GpuExpression = GpuAbs(child, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,7 @@ abstract class SparkBaseShims extends Spark30XShims with Logging {
GpuOverrides.expr[Abs](
"Absolute value",
ExprChecks.unaryProjectAndAstInputMatchesOutput(
TypeSig.implicitCastsAstTypes, TypeSig.gpuNumeric + TypeSig.DECIMAL_128_FULL,
TypeSig.numeric),
TypeSig.implicitCastsAstTypes, TypeSig.numeric, TypeSig.numeric),
(a, conf, p, r) => new UnaryAstExprMeta[Abs](a, conf, p, r) {
// ANSI support for ABS was added in 3.2.0 SPARK-33275
override def convertToGpu(child: Expression): GpuExpression = GpuAbs(child, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ abstract class SparkBaseShims extends Spark31XShims with Logging {
GpuOverrides.expr[Abs](
"Absolute value",
ExprChecks.unaryProjectAndAstInputMatchesOutput(
TypeSig.implicitCastsAstTypes, TypeSig.gpuNumeric + TypeSig.DECIMAL_128_FULL,
TypeSig.numeric),
TypeSig.implicitCastsAstTypes, TypeSig.numeric, TypeSig.numeric),
(a, conf, p, r) => new UnaryAstExprMeta[Abs](a, conf, p, r) {
// ANSI support for ABS was added in 3.2.0 SPARK-33275
override def convertToGpu(child: Expression): GpuExpression = GpuAbs(child, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ abstract class SparkBaseShims extends Spark30XShims with Logging {
GpuOverrides.expr[Abs](
"Absolute value",
ExprChecks.unaryProjectAndAstInputMatchesOutput(
TypeSig.implicitCastsAstTypes, TypeSig.gpuNumeric + TypeSig.DECIMAL_128_FULL,
TypeSig.numeric),
TypeSig.implicitCastsAstTypes, TypeSig.numeric, TypeSig.numeric),
(a, conf, p, r) => new UnaryAstExprMeta[Abs](a, conf, p, r) {
// ANSI support for ABS was added in 3.2.0 SPARK-33275
override def convertToGpu(child: Expression): GpuExpression = GpuAbs(child, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ trait Spark32XShims extends SparkShims with Logging {
GpuOverrides.expr[Abs](
"Absolute value",
ExprChecks.unaryProjectAndAstInputMatchesOutput(
TypeSig.implicitCastsAstTypes, TypeSig.gpuNumeric, TypeSig.numeric),
TypeSig.implicitCastsAstTypes, TypeSig.numeric, TypeSig.numeric),
(a, conf, p, r) => new UnaryAstExprMeta[Abs](a, conf, p, r) {
val ansiEnabled = SQLConf.get.ansiEnabled

Expand Down

0 comments on commit 0fdb1cb

Please sign in to comment.