stevenzwu commented on a change in pull request #1404:
URL: https://github.com/apache/iceberg/pull/1404#discussion_r481254536



##########
File path: 
flink/src/main/java/org/apache/iceberg/flink/sink/IcebergFilesCommitter.java
##########
@@ -88,6 +88,13 @@
   private transient Table table;
   private transient long maxCommittedCheckpointId;
 
+  // There're two cases that we restore from flink checkpoints: the first case 
is restoring from snapshot created by the
+  // same flink job; another case is restoring from snapshot created by 
another different job. For the second case, we
+  // need to maintain the old flink job's id in flink state backend to find 
the max-committed-checkpoint-id when
+  // traversing iceberg table's snapshots.
+  private static final ListStateDescriptor<String> JOB_ID_DESCRIPTOR = new 
ListStateDescriptor<>(

Review comment:
       fair enough. agree that we should expose the GenericDataFile.
   
   On the other hand, this can be simpler if we decided to just checkpoint the 
manifest file. Then we only need to track the manifest file path along with 
other metadata. Here is our Avro schema file.
   
   ```
   {
       "type": "record",
       "name": "ManifestFileState",
       "namespace": "com.netflix.spaas.nfflink.connector.iceberg.model",
       "fields": [
           {"name":"path", "type":"string"},
           {"name":"length", "type":"long"},
           {"name":"specId", "type":"int"},
           { "name":"checkpointId", "type": "long"},
           { "name":"checkpointTimestamp", "type": "long"},
           { "name":"dataFileCount", "type": "long"},
           { "name":"recordCount", "type": "long"},
           { "name":"byteCount", "type": "long"},
           { "name":"lowWatermark", "type": ["null", "long"], "default": null},
           { "name":"highWatermark", "type": ["null", "long"], "default": null}
       ]
   }
   ```




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

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