ahmedabu98 commented on code in PR #30910:
URL: https://github.com/apache/beam/pull/30910#discussion_r1574670744
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/FileWriteResult.java:
##########
@@ -92,6 +92,12 @@ private static Schema getDataFileAvroSchema(FileWriteResult
fileWriteResult) {
@Override
public void encode(FileWriteResult value, OutputStream outStream)
throws CoderException, IOException {
+ // "version" of this coder.
+ // If breaking changes are introduced (e.g. from Beam, Iceberg, Avro,
etc..),
+ // then update this version and create a fork in decode() below for the
new decode logic.
+ // This helps keep the pipeline update-compatible
+ outStream.write(0);
Review Comment:
Tests already exist in FileWriteResultTest:
https://github.com/apache/beam/blob/93aa62c2900b210ee5e26849949154f19db51f4c/sdks/java/io/iceberg/src/test/java/org/apache/beam/io/iceberg/FileWriteResultTest.java#L137-L142
I'm adding another encoding-decoding test though to check the version number
--
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]