gemini-code-assist[bot] commented on code in PR #37232:
URL: https://github.com/apache/beam/pull/37232#discussion_r2667013037
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/UngroupedWindmillReader.java:
##########
@@ -129,25 +131,46 @@ protected WindowedValue<T> decodeMessage(Windmill.Message
message) throws IOExce
drainingValueFromUpstream =
elementMetadata.getDrain() ==
BeamFnApi.Elements.DrainMode.Enum.DRAINING;
}
+
+ // Propagate record ID and offset
+ String recordId = null;
+ Long recordOffset = null;
+ if (context.offsetBasedDeduplicationSupported()) {
+ byte[] rawId = context.getCurrentRecordId();
+ if (rawId != null) {
Review Comment:

It's possible for `context.getCurrentRecordId()` to return an empty byte
array. This would result in `recordId` being an empty string. Downstream
processing in `WindmillSink` treats an empty record ID as an error and throws a
`RuntimeException`. To prevent this, you should also check that the `rawId` is
not empty before converting it to a string.
```suggestion
if (rawId != null && rawId.length > 0) {
```
--
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]