prashantwason commented on a change in pull request #1687:
URL: https://github.com/apache/hudi/pull/1687#discussion_r435501593



##########
File path: 
hudi-client/src/main/java/org/apache/hudi/io/storage/HoodieStorageWriterFactory.java
##########
@@ -34,29 +35,29 @@
 
 import java.io.IOException;
 
-import static org.apache.hudi.common.model.HoodieFileFormat.HOODIE_LOG;
 import static org.apache.hudi.common.model.HoodieFileFormat.PARQUET;
+import static org.apache.hudi.common.model.HoodieFileFormat.HFILE;
 
 public class HoodieStorageWriterFactory {
 
   public static <T extends HoodieRecordPayload, R extends IndexedRecord> 
HoodieStorageWriter<R> getStorageWriter(
       String instantTime, Path path, HoodieTable<T> hoodieTable, 
HoodieWriteConfig config, Schema schema,
       SparkTaskContextSupplier sparkTaskContextSupplier) throws IOException {
-    final String name = path.getName();
-    final String extension = FSUtils.isLogFile(path) ? 
HOODIE_LOG.getFileExtension() : FSUtils.getFileExtension(name);
+    final HoodieTableConfig tableConfig = 
hoodieTable.getMetaClient().getTableConfig();
+    final String extension = FSUtils.isLogFile(path) ? 
tableConfig.getLogFileFormat().getFileExtension() : 
tableConfig.getBaseFileFormat().getFileExtension();
     if (PARQUET.getFileExtension().equals(extension)) {
       return newParquetStorageWriter(instantTime, path, config, schema, 
hoodieTable, sparkTaskContextSupplier);
     }
+    if (HFILE.getFileExtension().equals(extension)) {
+      return newHFileStorageWriter(instantTime, path, config, schema, 
hoodieTable, sparkTaskContextSupplier);

Review comment:
       Done.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to