javrasya commented on code in PR #9464:
URL: https://github.com/apache/iceberg/pull/9464#discussion_r1451078255
##########
flink/v1.18/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java:
##########
@@ -147,7 +147,7 @@ byte[] serializeV2() throws IOException {
for (FileScanTask fileScanTask : fileScanTasks) {
String taskJson = FileScanTaskParser.toJson(fileScanTask);
- out.writeUTF(taskJson);
+ writeBytes(out, taskJson);
Review Comment:
The reason why I don't use out.writeBytes here is because it is buggy. The
position with buffer is already incremented by 1 [in
here](https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java#L161)
([Actual
place](https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java#L140)
where the increment happens) and it is incremented by the whole size once
again [in
here](https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java#L163)
which makes it problematic.
So I had to take some inspiration from that code and introduce a custom
version of it in the class further down.
--
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]