Skip to content

Commit b376028

Browse files
author
Angus Davis
committed
Return null if results are not wanted.
1 parent 5d6c56b commit b376028

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bigtable-hbase/src/main/java/com/google/cloud/bigtable/hbase/BigtableTable.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,13 @@ public Result append(Append append) throws IOException {
423423
try {
424424
com.google.bigtable.v1.Row response =
425425
client.readModifyWriteRow(appendRowRequest.build());
426-
return bigtableRowAdapter.adaptResponse(response);
426+
// The bigtable API will always return the mutated results. In order to maintain
427+
// compatibility, simply return null when results were not requested.
428+
if (append.isReturnResults()) {
429+
return bigtableRowAdapter.adaptResponse(response);
430+
} else {
431+
return null;
432+
}
427433
} catch (RuntimeException e) {
428434
LOG.error("Encountered Exception when executing append. Exception: %s", e);
429435
throw new IOException(

0 commit comments

Comments
 (0)