You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/03/24 02:51:09 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #8277: [HUDI-5976] Add fs in the constructor of HoodieAvroHFileReader

danny0405 commented on code in PR #8277:
URL: https://github.com/apache/hudi/pull/8277#discussion_r1147066368


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java:
##########
@@ -168,8 +170,14 @@ protected <T> ClosableIterator<HoodieRecord<T>> deserializeRecords(byte[] conten
     // Get schema from the header
     Schema writerSchema = new Schema.Parser().parse(super.getLogBlockHeader().get(HeaderMetadataType.SCHEMA));
 
+    HoodieLogBlockContentLocation blockContentLoc = getBlockContentLocation().get();
+    Configuration inlineConf = new Configuration(blockContentLoc.getHadoopConf());
+    inlineConf.set("fs." + InLineFileSystem.SCHEME + ".impl", InLineFileSystem.class.getName());
+    inlineConf.setClassLoader(InLineFileSystem.class.getClassLoader());
+
+    FileSystem fs = FSUtils.getFs(pathForReader.toString(), inlineConf);

Review Comment:
   In `#lookupRecords`, there is similar logic for generating the fs, can we abstract the code snippet into a common utitlies method like `#getFs` ?



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org