cloud-fan commented on a change in pull request #32090:
URL: https://github.com/apache/spark/pull/32090#discussion_r609867914



##########
File path: 
sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedColumnReader.java
##########
@@ -121,17 +120,19 @@ private boolean isDecimalTypeMatched(DataType dt) {
 
   private boolean canReadAsIntDecimal(DataType dt) {
     if (!DecimalType.is32BitDecimalType(dt)) return false;
-    return isDecimalTypeMatched(dt);
+    DecimalType d = (DecimalType) dt;
+    return isDecimalTypeMatched(d) || d.scale() == 0;

Review comment:
       `!isDecimalTypeMatched(d)` doesn't mean `DecimalMetadata` is null. Shall 
we put the `|| d.scale() == 0` in `isDecimalTypeMatched`?




-- 
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]

Reply via email to