shardulm94 commented on issue #227: ORC column map fix
URL: https://github.com/apache/incubator-iceberg/pull/227#issuecomment-561439577
 
 
   I saw issues with GenericOrcWriter w.r.t. date/time/timestamp/decimal types 
when I tried to extend `org.apache.iceberg.data.DataTest` for ORC. 
   
   e.g. 
   For date type
   ```
   java.lang.IllegalStateException: Not an instance of java.lang.Integer: 
1619-02-13
   
        at org.apache.iceberg.data.GenericRecord.get(GenericRecord.java:123)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$StructConverter.addValue(GenericOrcWriter.java:336)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$StructConverter.addValue(GenericOrcWriter.java:312)
   ```
   
   For timestamp type,
   ```
   java.lang.IllegalStateException: Not an instance of java.lang.Long: 
1978-08-10T16:28:30.954017Z
   
        at org.apache.iceberg.data.GenericRecord.get(GenericRecord.java:123)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$StructConverter.addValue(GenericOrcWriter.java:336)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$StructConverter.addValue(GenericOrcWriter.java:312)
   ```
   
   For decimal type,
   ```
   java.lang.ArithmeticException: Rounding necessary
   
        at java.math.BigDecimal.commonNeedIncrement(BigDecimal.java:4148)
        at java.math.BigDecimal.needIncrement(BigDecimal.java:4204)
        at java.math.BigDecimal.divideAndRound(BigDecimal.java:4112)
        at java.math.BigDecimal.setScale(BigDecimal.java:2452)
        at java.math.BigDecimal.longValueExact(BigDecimal.java:3090)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$Decimal18Converter.addValue(GenericOrcWriter.java:281)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$Decimal18Converter.addValue(GenericOrcWriter.java:259)
        at 
org.apache.iceberg.data.orc.GenericOrcWriter$StructConverter.addValue(GenericOrcWriter.java:336)
   ```
   We can probably address this in a future PR though?
   @edgarRd @rdblue Thoughts?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to