dongjoon-hyun commented on a change in pull request #31357:
URL: https://github.com/apache/spark/pull/31357#discussion_r565499039
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala
##########
@@ -282,20 +269,43 @@ private[parquet] class ParquetRowConverter(
// For INT32 backed decimals
case t: DecimalType if
parquetType.asPrimitiveType().getPrimitiveTypeName == INT32 =>
- val (precision, scale) = getPrecisionAndScale(parquetType, t)
- new ParquetIntDictionaryAwareDecimalConverter(precision, scale,
updater)
+ val metadata = parquetType.asPrimitiveType().getDecimalMetadata
+ if (metadata == null) {
+ // If the column is a plain INT32, we should pick the precision that
can host the largest
+ // INT32 value.
+ new ParquetIntDictionaryAwareDecimalConverter(
+ DecimalType.IntDecimal.precision, 0, updater)
Review comment:
Got it.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]