voonhous commented on code in PR #17763:
URL: https://github.com/apache/hudi/pull/17763#discussion_r2656083782
##########
hudi-hadoop-common/src/main/java/org/apache/hudi/io/storage/hadoop/HoodieAvroParquetReader.java:
##########
@@ -108,27 +108,27 @@ public Set<Pair<String, Long>> filterRowKeys(Set<String>
candidateRowKeys) {
@Override
protected ClosableIterator<IndexedRecord>
getIndexedRecordIterator(HoodieSchema schema) throws IOException {
//TODO boundary for now to revisit in later pr to use HoodieSchema
- return getIndexedRecordIteratorInternal(schema.getAvroSchema(),
Collections.emptyMap());
+ return getIndexedRecordIteratorInternal(schema, Collections.emptyMap());
}
@Override
public ClosableIterator<IndexedRecord> getIndexedRecordIterator(HoodieSchema
readerSchema, HoodieSchema requestedSchema) throws IOException {
//TODO boundary for now to revisit in later pr to use HoodieSchema
- return getIndexedRecordIteratorInternal(requestedSchema.getAvroSchema(),
Collections.emptyMap());
+ return getIndexedRecordIteratorInternal(requestedSchema,
Collections.emptyMap());
}
@Override
public ClosableIterator<IndexedRecord> getIndexedRecordIterator(HoodieSchema
readerSchema, HoodieSchema requestedSchema, Map<String, String> renamedColumns)
throws IOException {
//TODO boundary for now to revisit in later pr to use HoodieSchema
- return getIndexedRecordIteratorInternal(requestedSchema.getAvroSchema(),
renamedColumns);
+ return getIndexedRecordIteratorInternal(requestedSchema, renamedColumns);
}
@Override
public HoodieSchema getSchema() {
if (fileSchema.isEmpty()) {
- fileSchema = Option.ofNullable(parquetUtils.readAvroSchema(storage,
path));
+ fileSchema = Option.ofNullable(parquetUtils.readHoodieSchema(storage,
path));
}
- return HoodieSchema.fromAvroSchema(fileSchema.get());
+ return fileSchema.get();
Review Comment:
`fileSchema` is assigned to if it is empty.
Will modify it to:
```java
fileSchema = fileSchema.or(() ->
Option.ofNullable(parquetUtils.readSchema(storage, path)));
return fileSchema.get();
```
--
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]