Skip to content

Commit 774cf0e

Browse files
fix: table.batch should not return errors in the results array (#4507)
Change-Id: I9403a10e16536ac7bea4475e97e2218c48c07866 Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable-hbase/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> ☕️ If you write sample code, please follow the [samples format]( https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
1 parent 25b34d3 commit 774cf0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bigtable-client-core-parent/bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BatchExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public final void onSuccess(Object message) {
118118

119119
@Override
120120
public final void onFailure(Throwable throwable) {
121-
resultsArray[index] = throwable;
121+
resultsArray[index] = null;
122122
resultFuture.setException(throwable);
123123
}
124124
}

bigtable-client-core-parent/bigtable-hbase/src/test/java/com/google/cloud/bigtable/hbase/TestBatchExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public void testPartialResults() throws Exception {
257257
}
258258
assertTrue("first result is a result", results[0] instanceof Result);
259259
assertTrue(matchesRow(expected).matches(results[0]));
260-
Assert.assertEquals(exception, results[1]);
260+
Assert.assertNull(results[1]); // failed entries null out the result
261261
}
262262

263263
@Test

0 commit comments

Comments
 (0)