Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
yirutang committed Nov 7, 2023
1 parent 640cb3a commit 88c4327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ private StreamWriter(Builder builder) throws IOException {
this.streamName = builder.streamName;
this.writerSchema = builder.writerSchema;
this.defaultMissingValueInterpretation = builder.defaultMissingValueInterpretation;
this.enableLargerRequest = builder.enableLargerRequest;
BigQueryWriteSettings clientSettings = getBigQueryWriteSettings(builder);
if (!builder.enableConnectionPool) {
this.location = builder.location;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1574,15 +1574,16 @@ public void testLargeRequest() throws IOException, InterruptedException, Executi
.setWriterSchema(CreateProtoSchemaWithColField())
.enableLargerRequest()
.build()) {
List<Integer> sizeSet = Arrays.asList(200, 10 * 1024 * 1024, 19 * 1024 * 1024);
List<Integer> sizeSet = Arrays.asList(7 * 1024 * 1024, 19 * 1024 * 1024);
List<ApiFuture<AppendRowsResponse>> responseList =
new ArrayList<ApiFuture<AppendRowsResponse>>();
for (int i = 0; i < 20; i++) {
int size = sizeSet.get(new Random().nextInt(3));
LOG.info("Sending request of size: " + size);
for (int i = 0; i < 10; i++) {
responseList.add(
streamWriter.append(
CreateProtoRows(new String[] {new String(new char[sizeSet.get(0)]).replace("\0", "a")})));
responseList.add(
streamWriter.append(
CreateProtoRows(new String[] {new String(new char[size]).replace("\0", "a")})));
CreateProtoRows(new String[] {new String(new char[sizeSet.get(1)]).replace("\0", "a")})));
}
for (int i = 0; i < 20; i++) {
assertFalse(responseList.get(i).get().hasError());
Expand Down

0 comments on commit 88c4327

Please sign in to comment.