jonvex commented on code in PR #11171:
URL: https://github.com/apache/hudi/pull/11171#discussion_r1596185700


##########
hudi-common/src/main/java/org/apache/hudi/io/storage/HoodieAvroFileReaderFactory.java:
##########
@@ -45,11 +44,16 @@ protected HoodieFileReader newHFileFileReader(HoodieConfig 
hoodieConfig,
     if (isUseNativeHFileReaderEnabled(hoodieConfig)) {
       return new HoodieNativeAvroHFileReader(conf, path, schemaOption);
     }
-    CacheConfig cacheConfig = new 
CacheConfig(conf.unwrapAs(Configuration.class));
-    if (schemaOption.isPresent()) {
-      return new HoodieHBaseAvroHFileReader(conf, path, cacheConfig, 
HoodieStorageUtils.getStorage(path, conf), schemaOption);
+    try {
+      if (schemaOption.isPresent()) {
+        return (HoodieFileReader) 
ReflectionUtils.loadClass("org.apache.hudi.io.storage.HoodieHBaseAvroHFileReader",
+            new Class<?>[] {StorageConfiguration.class, StoragePath.class, 
Option.class}, conf, path, schemaOption);
+      }
+      return (HoodieFileReader) 
ReflectionUtils.loadClass("org.apache.hudi.io.storage.HoodieHBaseAvroHFileReader",
+          new Class<?>[] {StorageConfiguration.class, StoragePath.class}, 
conf, path);
+    } catch (HoodieException e) {
+      throw (IOException) e.getCause().getCause();

Review Comment:
   fixed, but has to be ioexception because that is expected by one of the 
callers



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