stevenzwu commented on code in PR #6528:
URL: https://github.com/apache/iceberg/pull/6528#discussion_r1062910081


##########
flink/v1.16/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergFilesCommitter.java:
##########
@@ -134,6 +136,7 @@ class IcebergFilesCommitter extends 
AbstractStreamOperator<Void>
   public void initializeState(StateInitializationContext context) throws 
Exception {
     super.initializeState(context);
     this.flinkJobId = 
getContainingTask().getEnvironment().getJobID().toString();
+    this.operatorUniqueId = getRuntimeContext().getOperatorUniqueID();

Review Comment:
   I did more experiment. if the `uidPrefix` is set in `FlinkSink`, then it 
seems that `getOperatorUniqueID`  does return a stable ID even if the job DAG 
changed.
   
   if `uidPrefix` is not set in `FlinkSink`, DAG change leads to 
unstable/different values from `getOperatorUniqueID`. This is not really a 
problem, because it is the same situation if we use operator `uid`. we should 
always set `uidPrefix` for `FlinkSink` as best practice for stateful committer 
operator.
   
   In summary, using `getOperatorUniqueID` seems acceptable to me.



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