openinx commented on code in PR #99:
URL: https://github.com/apache/flink-table-store/pull/99#discussion_r865671595


##########
flink-table-store-core/src/main/java/org/apache/flink/table/store/file/operation/FileStoreWriteImpl.java:
##########
@@ -81,19 +94,43 @@ public FileStoreWriteImpl(
     @Override
     public RecordWriter createWriter(
             BinaryRowData partition, int bucket, ExecutorService 
compactExecutor) {
+
         Long latestSnapshotId = pathFactory.latestSnapshotId();
-        if (latestSnapshotId == null) {
-            return createEmptyWriter(partition, bucket, compactExecutor);
-        } else {
-            return createMergeTreeWriter(
-                    partition,
-                    bucket,
-                    scan.withSnapshot(latestSnapshotId)
-                            
.withPartitionFilter(Collections.singletonList(partition))
-                            .withBucket(bucket).plan().files().stream()
-                            .map(ManifestEntry::file)
-                            .collect(Collectors.toList()),
-                    compactExecutor);
+        List<DataFileMeta> existingFileMetas = Lists.newArrayList();
+        if (latestSnapshotId != null) {
+            // Concat all the DataFileMeta of existing files into 
existingFileMetas.
+            scan.withSnapshot(latestSnapshotId)
+                    
.withPartitionFilter(Collections.singletonList(partition)).withBucket(bucket)
+                    .plan().files().stream()
+                    .map(ManifestEntry::file)
+                    .forEach(existingFileMetas::add);
+        }
+
+        switch (writeMode) {
+            case APPEND_ONLY:
+                SstPathFactory factory = 
pathFactory.createSstPathFactory(partition, bucket);

Review Comment:
   **TODO** :  This `SstPathFactory`  will also need to be refactored so that 
we don't expose the SST concept to the append-table table.



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