rdblue commented on a change in pull request #1648:
URL: https://github.com/apache/iceberg/pull/1648#discussion_r579886741



##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetAvro.java
##########
@@ -169,12 +164,14 @@ public String getLogicalTypeName() {
 
     @Override
     public BigDecimal fromFixed(GenericFixed value, Schema schema, LogicalType 
type) {
-      return super.fromFixed(value, schema, decimalsByScale[((ParquetDecimal) 
type).scale()]);
+      final ParquetDecimal dec = (ParquetDecimal) type;
+      return super.fromFixed(value, schema, 
LogicalTypes.decimal(dec.precision(), dec.scale()));

Review comment:
       This change results in creating a new `Decimal` for every value. While I 
don't think that we use this very much, I would rather not introduce object 
allocation for every conversion. Can you add a static cache for these? That was 
the purpose of `decimalsByScale`.




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