pvary commented on code in PR #15663:
URL: https://github.com/apache/iceberg/pull/15663#discussion_r2946536359
##########
flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java:
##########
@@ -204,15 +242,32 @@ private static IcebergSourceSplit deserialize(
tasks.add(task);
}
- CombinedScanTask combinedScanTask = new BaseCombinedScanTask(tasks);
- return IcebergSourceSplit.fromCombinedScanTask(combinedScanTask,
fileOffset, recordOffset);
+ FileIO fileIO = null;
+ if (version >= 4) {
+ if (in.readBoolean()) {
+ int length = in.readInt();
+ byte[] fileIOBytes = new byte[length];
+ in.read(fileIOBytes);
+ try {
+ fileIO =
+ InstantiationUtil.deserializeObject(
+ fileIOBytes, IcebergSourceSplit.class.getClassLoader());
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException("Failed to deserialize FileIO from
split", e);
+ }
+ }
+ }
+
+ return new IcebergSourceSplit(
+ new BaseCombinedScanTask(tasks), fileOffset, recordOffset, fileIO);
}
private static String readTaskJson(DataInputDeserializer in, int version)
throws IOException {
switch (version) {
case 2:
return in.readUTF();
case 3:
+ case 4:
Review Comment:
We will need to add some unit tests for the serialization
--
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]