bryanck commented on code in PR #8555:
URL: https://github.com/apache/iceberg/pull/8555#discussion_r1330958770
##########
flink/v1.17/flink/src/main/java/org/apache/iceberg/flink/sink/IcebergStreamWriter.java:
##########
@@ -54,16 +59,28 @@ public void open() {
this.attemptId = getRuntimeContext().getAttemptNumber();
this.writerMetrics = new IcebergStreamWriterMetrics(super.metrics,
fullTableName);
- // Initialize the task writer factory.
+ // Initialize the task writer factory before refreshing the table so that
the initial
+ // schema and partition spec are used.
this.taskWriterFactory.initialize(subTaskId, attemptId);
+ // Refresh the table if needed.
+ if (tableSupplier instanceof CachingTableSupplier) {
Review Comment:
As noted above, refreshing in the `get()` could lead to refreshes happening
at indeterminate times.
--
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]