pvary commented on code in PR #15329:
URL: https://github.com/apache/iceberg/pull/15329#discussion_r2814353071
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/source/RowDataFileScanTaskReader.java:
##########
@@ -112,23 +104,23 @@ private CloseableIterable<RowData> newIterable(
if (task.isDataTask()) {
throw new UnsupportedOperationException("Cannot read data task.");
} else {
- switch (task.file().format()) {
- case PARQUET:
- iter = newParquetIterable(task, schema, idToConstant,
inputFilesDecryptor);
- break;
-
- case AVRO:
- iter = newAvroIterable(task, schema, idToConstant,
inputFilesDecryptor);
- break;
-
- case ORC:
- iter = newOrcIterable(task, schema, idToConstant,
inputFilesDecryptor);
- break;
-
- default:
- throw new UnsupportedOperationException(
- "Cannot read unknown format: " + task.file().format());
+ ReadBuilder<RowData, RowType> builder =
+ FormatModelRegistry.readBuilder(
+ task.file().format(), RowData.class,
inputFilesDecryptor.getInputFile(task));
+
+ if (nameMapping != null) {
+ builder.withNameMapping(NameMappingParser.fromJson(nameMapping));
}
+
+ iter =
+ builder
+ .project(schema)
+ .idToConstant(idToConstant)
+ .split(task.start(), task.length())
+ .caseSensitive(caseSensitive)
+ .filter(task.residual())
+ .reuseContainers()
Review Comment:
We check that the value is always set to the expected value:
https://github.com/apache/iceberg/blob/ebaafdeb35ed892e95f1d9b4666a18d393c95876/orc/src/main/java/org/apache/iceberg/orc/ORCFormatModel.java#L290-L291
--
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]