kgyrtkirk commented on a change in pull request #1789:
URL: https://github.com/apache/hive/pull/1789#discussion_r758402670
##########
File path: jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
##########
@@ -587,6 +587,26 @@ public int getUpdateCount() throws SQLException {
return (int) numModifiedRows;
}
+ @Override
+ public long getLargeUpdateCount() throws SQLException {
+ checkConnection("getLargeUpdateCount");
+ /**
+ * Poll on the operation status, till the operation is complete. We want
to ensure that since a
+ * client might end up using executeAsync and then call this to check if
the query run is
+ * finished.
+ */
+ long numModifiedRows = -1L;
+ TGetOperationStatusResp resp = waitForOperationToComplete();
+ if (resp != null) {
+ numModifiedRows = resp.getNumModifiedRows();
+ }
+ if (numModifiedRows == -1L || numModifiedRows > Long.MAX_VALUE) {
+ LOG.warn("Invalid number of updated rows: {}", numModifiedRows);
+ return -1;
Review comment:
I'm not sure if returning `-1` is the best way to signal this
problems... especially in the old `getUpdateCount` method
##########
File path: jdbc/src/java/org/apache/hive/jdbc/HiveStatement.java
##########
@@ -587,6 +587,26 @@ public int getUpdateCount() throws SQLException {
return (int) numModifiedRows;
}
+ @Override
+ public long getLargeUpdateCount() throws SQLException {
+ checkConnection("getLargeUpdateCount");
+ /**
+ * Poll on the operation status, till the operation is complete. We want
to ensure that since a
+ * client might end up using executeAsync and then call this to check if
the query run is
+ * finished.
+ */
+ long numModifiedRows = -1L;
+ TGetOperationStatusResp resp = waitForOperationToComplete();
+ if (resp != null) {
+ numModifiedRows = resp.getNumModifiedRows();
+ }
+ if (numModifiedRows == -1L || numModifiedRows > Long.MAX_VALUE) {
Review comment:
is `-2` valid?
we could reuse the newly implemented method in the old `getUpdateCount` to
reduce code duplication
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]