nsivabalan commented on code in PR #14085:
URL: https://github.com/apache/hudi/pull/14085#discussion_r2433501049


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/buffer/FileGroupRecordBuffer.java:
##########
@@ -193,15 +193,19 @@ public void close() {
    */
   protected Pair<ClosableIterator<T>, Schema> 
getRecordsIterator(HoodieDataBlock dataBlock, Option<KeySpec> keySpecOpt) {
     ClosableIterator<T> blockRecordsIterator;
-    if (keySpecOpt.isPresent()) {
-      KeySpec keySpec = keySpecOpt.get();
-      blockRecordsIterator = dataBlock.getEngineRecordIterator(readerContext, 
keySpec.getKeys(), keySpec.isFullKey());
-    } else {
-      blockRecordsIterator = dataBlock.getEngineRecordIterator(readerContext);
+    try {
+      if (keySpecOpt.isPresent()) {
+        KeySpec keySpec = keySpecOpt.get();
+        blockRecordsIterator = 
dataBlock.getEngineRecordIterator(readerContext, keySpec.getKeys(), 
keySpec.isFullKey());
+      } else {
+        blockRecordsIterator = 
dataBlock.getEngineRecordIterator(readerContext);
+      }
+      Pair<Function<T, T>, Schema> schemaTransformerWithEvolvedSchema = 
getSchemaTransformerWithEvolvedSchema(dataBlock);
+      return Pair.of(new CloseableMappingIterator<>(
+          blockRecordsIterator, schemaTransformerWithEvolvedSchema.getLeft()), 
schemaTransformerWithEvolvedSchema.getRight());
+    } catch (IOException e) {

Review Comment:
   we could catch IOException w/n getEngineRecordIterator and throw 
HoodieIOException. 
   all methods in `HoodieSeekingFileReader` throws IOException. 
   so, I feel we should be good. 



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

Reply via email to