From 94344bdc8375a356c1eb7ebabc67a75c0859b0e3 Mon Sep 17 00:00:00 2001 From: Anton Okolnychyi Date: Fri, 22 Jan 2021 10:05:12 -0800 Subject: [PATCH] Spark: Fix bucketed trasnform expression --- .../spark/sql/catalyst/expressions/TransformExpressions.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/expressions/TransformExpressions.scala b/spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/expressions/TransformExpressions.scala index 259c9f20b000..4148b05a2ccb 100644 --- a/spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/expressions/TransformExpressions.scala +++ b/spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/expressions/TransformExpressions.scala @@ -99,7 +99,7 @@ case class IcebergBucketTransform(numBuckets: Int, child: Expression) extends Ic @transient lazy val bucketFunc: Any => Int = child.dataType match { case _: DecimalType => val t = Transforms.bucket[Any](icebergInputType, numBuckets) - d: Any => t(d.asInstanceOf[Decimal].toBigDecimal).toInt + d: Any => t(d.asInstanceOf[Decimal].toJavaBigDecimal).toInt case _: StringType => // the spec requires that the hash of a string is equal to the hash of its UTF-8 encoded bytes // TODO: pass bytes without the copy out of the InternalRow