sqd commented on code in PR #15433:
URL: https://github.com/apache/iceberg/pull/15433#discussion_r3017993183


##########
flink/v2.0/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/DynamicIcebergSink.java:
##########
@@ -411,12 +488,32 @@ public DataStreamSink<DynamicRecordInternal> append() {
               .name(operatorName("generator"))
               .returns(type);
 
-      DataStreamSink<DynamicRecordInternal> rowDataDataStreamSink =
+      // Forward writer: chained with generator via forward edge, no data 
shuffle
+      ForwardWriterSink forwardWriterSink =
+          new ForwardWriterSink(
+              sink.catalogLoader, sink.writeProperties, sink.flinkConfig, 
sink.cacheMaximumSize);
+      TypeInformation<CommittableMessage<DynamicWriteResult>> 
writeResultTypeInfo =
+          CommittableMessageTypeInfo.of(sink::getWriteResultSerializer);
+
+      DataStream<CommittableMessage<DynamicWriteResult>> forwardWritten =
+          converted
+              .getSideOutput(
+                  new 
OutputTag<>(DynamicRecordProcessor.DYNAMIC_FORWARD_STREAM, sideOutputType))
+              .transform(
+                  operatorName("Forward-Writer"),
+                  writeResultTypeInfo,
+                  new SinkWriterOperatorFactory<>(forwardWriterSink))
+              .uid(prefixIfNotNull(uidPrefix, "-forward-writer"));
+
+      // Inject forward write results into sink — they'll be unioned in 
addPreCommitTopology
+      sink.setForwardWriteResults(forwardWritten);

Review Comment:
   Fixed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to