rdblue opened a new issue #1396:
URL: https://github.com/apache/iceberg/issues/1396


   When we try to read a Parquet file with a map using `NameMapping`, it fails 
because the schema generated has a different name for the key/value pair struct:
   
   ```
   org.apache.iceberg.bdp.shaded.org.apache.parquet.io.InvalidRecordException: 
key_value not found in optional group properties (MAP) = 1 {
     repeated group map {
       required binary key (UTF8) = 8;
       optional binary value (UTF8) = 9;
     }
   }
        at 
org.apache.iceberg.bdp.shaded.org.apache.parquet.schema.GroupType.getFieldIndex(GroupType.java:146)
        at 
org.apache.iceberg.bdp.shaded.org.apache.parquet.schema.GroupType.getType(GroupType.java:178)
        at 
org.apache.iceberg.bdp.shaded.org.apache.parquet.schema.GroupType.getType(GroupType.java:282)
        at 
org.apache.iceberg.bdp.shaded.org.apache.parquet.schema.GroupType.getType(GroupType.java:282)
        at 
org.apache.iceberg.bdp.shaded.org.apache.parquet.schema.MessageType.getType(MessageType.java:90)
        at 
org.apache.iceberg.parquet.ParquetMetricsRowGroupFilter$MetricsEvalVisitor.eval(ParquetMetricsRowGroupFilter.java:91)
        at 
org.apache.iceberg.parquet.ParquetMetricsRowGroupFilter$MetricsEvalVisitor.access$100(ParquetMetricsRowGroupFilter.java:77)
        at 
org.apache.iceberg.parquet.ParquetMetricsRowGroupFilter.shouldRead(ParquetMetricsRowGroupFilter.java:71)
        at org.apache.iceberg.parquet.ReadConf.<init>(ReadConf.java:99)
        at org.apache.iceberg.parquet.ParquetReader.init(ParquetReader.java:66)
        at 
org.apache.iceberg.parquet.ParquetReader.iterator(ParquetReader.java:77)
        at 
org.apache.iceberg.spark.source.RowDataReader.open(RowDataReader.java:103)
        at 
org.apache.iceberg.spark.source.BaseDataReader.next(BaseDataReader.java:73)
   ```
   
   The names generated when applying the name mapping do not match the original 
schema. The name mapping code should be updated to add field IDs and not change 
anything else in the file schema.


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

Reply via email to