haridsv commented on code in PR #2199: URL: https://github.com/apache/phoenix/pull/2199#discussion_r2161722933
########## phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java: ########## @@ -1656,7 +1665,13 @@ public void postBatchMutateIndispensably(ObserverContext<RegionCoprocessorEnviro List<Cell> cells = new ArrayList<>(); cells.add(cell); - addCellsIfResultReturned(miniBatchOp, context, cells); + if (!context.returnOldRow) { + addCellsIfResultReturned(miniBatchOp, context.returnResult, cells, + context.currColumnCellExprMap, false); + } else { + addCellsIfResultReturned(miniBatchOp, context.returnResult, cells, + context.oldRowColumnCellExprMap, true); + } Review Comment: Why not return both old and new row state and provide a single interface? ########## phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/PhoenixPreparedStatement.java: ########## @@ -215,6 +215,28 @@ private void preExecuteUpdate() throws SQLException { } } + /** + * Executes the given SQL statement similar to JDBC API executeUpdate() but also returns the + * old row (before update) as Result object back to the client. This must be used with + * auto-commit Connection. This makes the operation atomic. + * If the row is successfully updated, return the old row (state before update), otherwise if + * the row cannot be updated, return non-updated (old) row. Review Comment: Do you mean "Return the old row (state before update) whether the update is successful or not"? -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org