Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/17056#discussion_r103096516
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/HashExpressionsSuite.scala
---
@@ -371,6 +370,48 @@ class HashExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
new StructType().add("array", arrayOfString).add("map",
mapOfString))
.add("structOfUDT", structOfUDT))
+ test("hive-hash for decimal") {
+ def checkHiveHashForDecimal(
+ input: String,
+ precision: Int,
+ scale: Int,
+ expected: Long): Unit = {
+ val decimal = Decimal.apply(new java.math.BigDecimal(input))
+ decimal.changePrecision(precision, scale)
+ val decimalType = DataTypes.createDecimalType(precision, scale)
+ checkHiveHash(decimal, decimalType, expected)
+ }
+
+ checkHiveHashForDecimal("18", 38, 0, 558)
--- End diff --
A quick question: these expected values are got from Hive?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]