Skip to content

Commit

Permalink
Remove another setter method and some nits.
Browse files Browse the repository at this point in the history
  • Loading branch information
yifatgortler committed Jul 30, 2024
1 parent 847c313 commit 3354847
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ public Builder setDefaultMissingValueInterpretation(
*
* @param missingValueInterpretationMap the missing value interpretation map used by the
* JsonStreamWriter.
* @return Builder
*/
public Builder setMissingValueInterpretationMap(
Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ public Builder setDefaultMissingValueInterpretation(
*
* @param missingValueInterpretationMap the missing value interpretation map used by the
* SchemaAwareStreamWriter.
* @return Builder
*/
public Builder setMissingValueInterpretationMap(
Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,6 @@ private void validateFetchedConnectonPool(StreamWriter.Builder builder) {
}
}

/**
* Sets the missing value interpretation map for the stream writer. The input
* missingValueInterpretationMap is used for all write requests unless otherwise changed.
*
* @param missingValueInterpretationMap the missing value interpretation map used by stream
* writer.
*/
public void setMissingValueInterpretationMap(
Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) {
this.missingValueInterpretationMap = missingValueInterpretationMap;
}

/**
* Schedules the writing of rows at the end of current stream.
*
Expand Down Expand Up @@ -861,6 +849,7 @@ public Builder setDefaultMissingValueInterpretation(
*
* @param missingValueInterpretationMap the missing value interpretation map used by stream
* writer.
* @return Builder
*/
public Builder setMissingValueInterpretationMap(
Map<String, AppendRowsRequest.MissingValueInterpretation> missingValueInterpretationMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1599,18 +1599,13 @@ public void testAppendWithoutMissingValueMap() throws Exception {

testBigQueryWrite.addResponse(createAppendResponse(0));

// The first append doesn't use a missing value map.
ApiFuture<AppendRowsResponse> responseFuture =
writer.append(createProtoRows(new String[] {String.valueOf(0)}), 0);

assertEquals(0, responseFuture.get().getAppendResult().getOffset().getValue());

// Ensure that the AppendRowsRequest for the first append operation does not have a missing
// value map, and that the second AppendRowsRequest has the missing value map provided in the
// second append.
verifyAppendRequests(1);
AppendRowsRequest request1 = testBigQueryWrite.getAppendRequests().get(0);
assertTrue(request1.getMissingValueInterpretations().isEmpty());
assertTrue(testBigQueryWrite.getAppendRequests().get(0).getMissingValueInterpretations().isEmpty());
}
}

Expand All @@ -1625,7 +1620,6 @@ public void testAppendWithMissingValueMap() throws Exception {

testBigQueryWrite.addResponse(createAppendResponse(0));

// The first append doesn't use a missing value map.
ApiFuture<AppendRowsResponse> responseFuture =
writer.append(createProtoRows(new String[] {String.valueOf(0)}), 0);

Expand Down

0 comments on commit 3354847

Please sign in to comment.