Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Feb 27, 2024
1 parent bc5da15 commit 322cdbf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ public static void writeToDefaultStream(
TableName parentTable = TableName.of(projectId, datasetName, tableName);
try (JsonStreamWriter writer =
JsonStreamWriter.newBuilder(parentTable.toString(), tableSchema)
.setRetrySettings(retrySettings).build()) {
.setRetrySettings(retrySettings)
.build()) {

ApiFuture<AppendRowsResponse> future = writer.append(data);
// The append method is asynchronous. Rather than waiting for the method to complete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ void initialize(TableName parentTable, BigQueryWriteClient client)
// https://googleapis.dev/java/google-cloud-bigquerystorage/latest/com/google/cloud/bigquery/storage/v1beta2/JsonStreamWriter.html
streamWriter =
JsonStreamWriter.newBuilder(writeStream.getName(), writeStream.getTableSchema())
.setRetrySettings(retrySettings).build();
.setRetrySettings(retrySettings)
.build();
}

public void append(JSONArray data, long offset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@
import com.google.cloud.bigquery.storage.v1.Exceptions.StorageException;
import com.google.cloud.bigquery.storage.v1.JsonStreamWriter;
import com.google.cloud.bigquery.storage.v1.TableName;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.protobuf.Descriptors.DescriptorValidationException;
import io.grpc.Status;
import io.grpc.Status.Code;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.Executors;
Expand All @@ -63,7 +60,7 @@ public static void runWriteToDefaultStream()
}

private static ByteString buildByteString() {
byte[] bytes = new byte[]{1, 2, 3, 4, 5};
byte[] bytes = new byte[] {1, 2, 3, 4, 5};
return ByteString.copyFrom(bytes);
}

Expand Down

0 comments on commit 322cdbf

Please sign in to comment.