chenjunjiedada commented on issue #1396:
URL: https://github.com/apache/iceberg/issues/1396#issuecomment-683745049
So the name mapping is created from a custom schema which converted from
custom parquet schema, and some of the field names do not match the data file's
field names. Correct?
IIUC, we could detect whether data files' field names exist in
`typeWithIds`. Does that sound reasonable to you?
``` java
for (ColumnChunkMetaData col : rowGroup.getColumns()) {
if (fileSchema.containsPath(col.getPath().toArray())) {
PrimitiveType colType =
fileSchema.getType(col.getPath().toArray()).asPrimitiveType();
if (colType.getId() != null) {
int id = colType.getId().intValue();
stats.put(id, col.getStatistics());
valueCounts.put(id, col.getValueCount());
conversions.put(id,
ParquetConversions.converterFromParquet(colType));
}
}
}
```
----------------------------------------------------------------
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]