sadhen commented on a change in pull request #24092: [WIP][SPARK-27160][SQL]
Fix DecimalType literal casting
URL: https://github.com/apache/spark/pull/24092#discussion_r265592650
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala
##########
@@ -136,10 +137,7 @@ private[sql] object OrcFilters {
case FloatType | DoubleType =>
value.asInstanceOf[Number].doubleValue()
case _: DecimalType =>
- val decimal = value.asInstanceOf[java.math.BigDecimal]
- val decimalWritable = new HiveDecimalWritable(decimal.longValue)
- decimalWritable.mutateEnforcePrecisionScale(decimal.precision,
decimal.scale)
Review comment:
https://github.com/apache/orc/blob/d1d2a37842087501933d594a71cd1f5f5c4a5a9e/java/core/src/java/org/apache/orc/impl/RecordReaderImpl.java#L784
There are similar conversions in the ORC project.
@dongjoon-hyun Why do we need mutateEnforcePrecisionScale ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]