tkhurana commented on code in PR #1884:
URL: https://github.com/apache/phoenix/pull/1884#discussion_r1600456702
##########
phoenix-core-client/src/main/java/org/apache/phoenix/execute/MutationState.java:
##########
@@ -1415,8 +1425,23 @@ public List<Mutation> getMutationList() {
}, iwe, connection,
connection.getQueryServices().getProps());
shouldRetryIndexedMutation = false;
} else {
- hTable.batch(mutationBatch, null);
+ hTable.batch(mutationBatch, resultObjects);
+ }
+
+ if (connection.getAutoCommit()) {
+ for (int i = 0; i < mutationBatch.size(); i++) {
+ Result result = (Result) resultObjects[i];
+ if (result != null && !result.isEmpty()) {
+ Cell cell = result.rawCells()[0];
+ numUpdatedRowsForAutoCommit =
PInteger.INSTANCE.getCodec()
Review Comment:
Now we have 2 APIs on the MutationState object `getUpdateCount()` and
`getNumUpdatedRowsForAutoCommit()`. They server a similar purpose but can give
different results under some conditions. We should just keep the original API
`getUpdateCount` which should handle all the conditions and give the correct
result.
One idea is we could introduce a new field called `numRowsIgnored`
initialized to 0. Then if the Result cell is 0 that means the row is ignored
and we increment `numRowsIgnored`. Now in `getUpdateCount` we simply return
`numRows - numRowsIgnored`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]