pvary commented on code in PR #12979:
URL: https://github.com/apache/iceberg/pull/12979#discussion_r2104208183


##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergSink.java:
##########
@@ -216,7 +235,44 @@ public SimpleVersionedSerializer<IcebergCommittable> 
getCommittableSerializer()
   @Override
   public void addPostCommitTopology(
       DataStream<CommittableMessage<IcebergCommittable>> committables) {
-    // TODO Support small file compaction
+
+    if (!compactMode) {
+      return;
+    }
+
+    SingleOutputStreamOperator<TableChange> tableChangeStream =
+        committables
+            .global()
+            .process(new 
CommittableToTableChangeConverter(tableLoader.clone()))
+            .uid("committable-to-table-change-converter")
+            .forceNonParallel();
+    try {
+
+      RewriteDataFiles.Builder rewriteBuilder =
+          RewriteDataFiles.builder().properties(compactProperties);
+
+      TriggerLockFactory triggerLockFactory =
+          LockFactoryBuilder.build(compactProperties, table.name());
+      TableMaintenance.Builder builder =
+          TableMaintenance.forChangeStream(tableChangeStream, tableLoader, 
triggerLockFactory)

Review Comment:
   Shall we add the `uidSuffix` to the TableMaintenance process?



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to