You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/11/22 09:07:09 UTC

[GitHub] [hive] abstractdog opened a new pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

abstractdog opened a new pull request #1789:
URL: https://github.com/apache/hive/pull/1789


   ### What changes were proposed in this pull request?
   We should use java.sql.getLargeUpdateCount() where it's possible. User-facing case is beeline output.
   
   ### Why are the changes needed?
   Because this can be confusing for the user on beeline output:
   ```
   20/12/16 01:37:36 [main]: WARN jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE
   ```
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, beeline is supposed to return row numbers > Integer.MAX_VALUE properly.
   
   ### How was this patch tested?
   Not yet tested.
   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1789:
URL: https://github.com/apache/hive/pull/1789


   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1789:
URL: https://github.com/apache/hive/pull/1789#issuecomment-782482366


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] commented on pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #1789:
URL: https://github.com/apache/hive/pull/1789#issuecomment-1024761518


   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] kgyrtkirk commented on a change in pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1789:
URL: https://github.com/apache/hive/pull/1789


   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1789:
URL: https://github.com/apache/hive/pull/1789


   


-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] github-actions[bot] closed pull request #1789: HIVE-24545: jdbc.HiveStatement: Number of rows is greater than Integer.MAX_VALUE

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #1789:
URL: https://github.com/apache/hive/pull/1789


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org