codope commented on code in PR #12993:
URL: https://github.com/apache/hudi/pull/12993#discussion_r2002297504
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/ColumnStatsIndexSupport.scala:
##########
@@ -490,13 +491,19 @@ object ColumnStatsIndexSupport {
case ShortType => value.asInstanceOf[Int].toShort
case ByteType => value.asInstanceOf[Int].toByte
- // TODO fix
- case _: DecimalType =>
+ case dt: DecimalType =>
value match {
case buffer: ByteBuffer =>
- val logicalType =
DecimalWrapper.SCHEMA$.getField("value").schema().getLogicalType
- decConv.fromBytes(buffer, null, logicalType)
- case _ => value
+ // Use the DecimalType's precision and scale (instead of using the
schema from DecimalWrapper)
Review Comment:
Correct no storage. The issue is only when reading the colstats. Actual type
was lost.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]