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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]