vinishjail97 commented on code in PR #772:
URL: https://github.com/apache/incubator-xtable/pull/772#discussion_r2641153254


##########
xtable-core/src/main/java/org/apache/xtable/hudi/BaseFileUpdatesExtractor.java:
##########
@@ -82,16 +93,50 @@ ReplaceMetadata extractSnapshotChanges(
         HoodieMetadataConfig.newBuilder()
             .enable(metaClient.getTableConfig().isMetadataTableAvailable())
             .build();
-    HoodieTableFileSystemView fsView =
-        new HoodieMetadataFileSystemView(
-            engineContext, metaClient, metaClient.getActiveTimeline(), 
metadataConfig);
+    HoodieTableMetadata tableMetadata =
+        metadataConfig.isEnabled()
+            ? metaClient
+                .getTableFormat()
+                .getMetadataFactory()
+                .create(
+                    engineContext,
+                    metaClient.getStorage(),
+                    metadataConfig,
+                    tableBasePath.toString(),
+                    true)
+            : null;
+    FileSystemViewManager fileSystemViewManager =
+        FileSystemViewManager.createViewManager(
+            engineContext,
+            metadataConfig,
+            FileSystemViewStorageConfig.newBuilder()
+                .withStorageType(FileSystemViewStorageType.MEMORY)
+                .build(),
+            HoodieCommonConfig.newBuilder().build(),
+            meta -> tableMetadata);
+    try (SyncableFileSystemView fsView = 
fileSystemViewManager.getFileSystemView(metaClient)) {
+      return extractFromFsView(partitionedDataFiles, commit, fsView, 
metaClient, metadataConfig);
+    } finally {
+      fileSystemViewManager.close();
+      if (tableMetadata != null) {
+        tableMetadata.close();
+      }
+    }
+  }
+
+  ReplaceMetadata extractFromFsView(
+      List<PartitionFileGroup> partitionedDataFiles,
+      String commit,
+      SyncableFileSystemView fsView,
+      HoodieTableMetaClient metaClient,
+      HoodieMetadataConfig metadataConfig) {
     boolean isTableInitialized = metaClient.isTimelineNonEmpty();
     // Track the partitions that are not present in the snapshot, so the files 
for those partitions
     // can be dropped
+    HoodieIndexVersion indexVersion =
+        existingIndexVersionOrDefault(PARTITION_NAME_COLUMN_STATS, metaClient);

Review Comment:
   This is a static function from hudi.



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