You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/03/15 18:20:58 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #1648: Move to Apache Avro 1.10.1

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



##########
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:
       I think it's fine to delegate to `toFixed`. I just don't want to call `LogicalTypes.decimal` every time to create a new decimal `LogicalType` with the same scale and precision. I think just adding a cache keyed by a `Pair` of scale and precision would fix 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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org