huaxingao commented on code in PR #1920: URL: https://github.com/apache/datafusion-comet/pull/1920#discussion_r2167873990
########## common/src/main/java/org/apache/comet/parquet/FileReader.java: ########## @@ -128,6 +134,48 @@ public FileReader(InputFile file, ParquetReadOptions options, ReadOptions cometO this(file, null, options, cometOptions, null); } + /** This constructor is called from Apache Iceberg. */ + public FileReader( + Path path, + Configuration conf, + ReadOptions cometOptions, + Map<String, String> properties, + Long start, + Long length, + byte[] fileEncryptionKey, + byte[] fileAADPrefix) + throws IOException { + ParquetReadOptions options = + buildParquetReadOptions(conf, properties, start, length, fileEncryptionKey, fileAADPrefix); + this.converter = new ParquetMetadataConverter(options); + this.file = HadoopInputFile.fromPath(path, conf); Review Comment: I think we can use `CometInputFile`. Modified. ########## common/src/main/java/org/apache/comet/parquet/FileReader.java: ########## @@ -209,6 +257,55 @@ public void setRequestedSchema(List<ColumnDescriptor> projection) { } } + /** This method is called from Apache Iceberg. */ + public void setRequestedSchemaFromSpecs(List<ParquetColumnSpec> specList) { + paths.clear(); + for (ParquetColumnSpec colSpec : specList) { + ColumnDescriptor descriptor = Utils.buildColumnDescriptor(colSpec); + paths.put(ColumnPath.get(colSpec.getPath()), descriptor); + } + } + + private static ParquetReadOptions buildParquetReadOptions( + Configuration conf, + Map<String, String> properties, + Long start, + Long length, + byte[] fileEncryptionKey, + byte[] fileAADPrefix) { + + Collection<String> readPropertiesToRemove = + Sets.newHashSet( + "parquet.read.filter", Review Comment: Changed -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org