edgarRd opened a new issue, #7122:
URL: https://github.com/apache/iceberg/issues/7122

   ### Apache Iceberg version
   
   1.1.0 (latest release)
   
   ### Query engine
   
   Hive
   
   ### Please describe the bug 🐞
   
   When using Hive `2.3.4` to read Iceberg tables, I've found cases where reads 
fail with:
   
   ```
   java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
     at java.util.ArrayList.rangeCheck(ArrayList.java:659)
     at java.util.ArrayList.get(ArrayList.java:435)
     at 
org.apache.iceberg.mr.hive.HiveIcebergFilterFactory.translateLeaf(HiveIcebergFilterFactory.java:111)
     at 
org.apache.iceberg.mr.hive.HiveIcebergFilterFactory.translate(HiveIcebergFilterFactory.java:82)
     at 
org.apache.iceberg.mr.hive.HiveIcebergFilterFactory.translate(HiveIcebergFilterFactory.java:76)
     at 
org.apache.iceberg.mr.hive.HiveIcebergFilterFactory.generateFilterExpression(HiveIcebergFilterFactory.java:53)
     at 
org.apache.iceberg.mr.hive.HiveIcebergInputFormat.getSplits(HiveIcebergInputFormat.java:90)
     at 
org.apache.hadoop.hive.ql.io.HiveInputFormat.addSplitsForGroup(HiveInputFormat.java:442)
     at 
org.apache.hadoop.hive.ql.io.HiveInputFormat.getSplits(HiveInputFormat.java:561)
     at 
org.apache.hadoop.hive.ql.exec.tez.HiveSplitGenerator.initialize(HiveSplitGenerator.java:196)
   ```
   
   My hypothesis is that Hive has run an optimization compacting leaves in the 
expression tree but the actual `tree` in the `SearchArguments` is not compacted 
to reflect this, leading to trying to access an index in the leaves that does 
not exist. This is possibly a bug in Hive (i.e. `tree` and `leaves` are not 
in-sync) but we can handle in Iceberg InputFormat by throwing 
`UnsupportedOperationException` avoiding the translation of the filter at all 
to pass down to Iceberg, the filter will later be applied by Hive, just like we 
handle other failure cases when converting `SearchArguments`.


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

To unsubscribe, e-mail: [email protected]

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