stankiewicz commented on code in PR #39124:
URL: https://github.com/apache/beam/pull/39124#discussion_r3493229658
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:
##########
@@ -2105,9 +2105,10 @@ public static <T> void readSource(
// the same order.
BoundedSource.BoundedReader<T> reader =
streamSource.createReader(options);
+ T current = null;
try {
if (reader.start()) {
- outputReceiver.get(rowTag).output(reader.getCurrent());
+ current = reader.getCurrent();
Review Comment:
can you apply this recommendation? thanks!
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.java:
##########
@@ -2120,11 +2121,15 @@ public static <T> void readSource(
(Exception) e.getCause(),
"Unable to parse record reading from BigQuery");
}
+ if (current != null) {
+ outputReceiver.get(rowTag).output(current);
+ }
while (true) {
+ current = null;
try {
if (reader.advance()) {
- outputReceiver.get(rowTag).output(reader.getCurrent());
+ current = reader.getCurrent();
Review Comment:
can you apply this recommendation? thanks!
--
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]