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 2019/03/15 18:20:21 UTC

[GitHub] [incubator-iceberg] aokolnychyi commented on issue #131: Fix collection of bounds for small decimals in ParquetMetrics

aokolnychyi commented on issue #131: Fix collection of bounds for small decimals in ParquetMetrics
URL: https://github.com/apache/incubator-iceberg/pull/131#issuecomment-473393292
 
 
   @rdblue Let's assume we have `3.50` as Decimal(10, 2), which is represented as INT64 in Parquet.
   
   ```
   file schema: table 
   --------------------------------------------------------------------------------
   decimalCol:  OPTIONAL INT64 O:DECIMAL R:0 D:1
   
   row group 1: RC:1 TS:75 OFFSET:4 
   --------------------------------------------------------------------------------
   decimalCol:   INT64 GZIP DO:0 FPO:4 SZ:91/75/0.82 VC:1 ENC:BIT_PACKED,PLAIN,RLE ST:[min: 3.50, max: 3.50, num_nulls: 0]
   ```
   
   Once we read the footer and call `stats.genericGetMin()` for this decimal column, we will get `350`. This value must be properly scaled (handled by `converterFromParquet`) before creating a literal.
   
   Right now, `Literals.of((Long) 350).to(DecimalType.of(10, 2)` will give us `350.00` instead of `3.50`.

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


With regards,
Apache Git Services

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