[ 
https://issues.apache.org/jira/browse/HIVE-22853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17049271#comment-17049271
 ] 

David Mollitor edited comment on HIVE-22853 at 3/2/20 2:55 PM:
---------------------------------------------------------------

{code:java|title=BeeLine.java}
+  public int fetchSize = -1;

+  public void setFetchSize(int fetchRows) {
+    if (fetchRows <= 0) { // if set to 0 or less, use server side default
+      this.fetchSize = Utils.getServerDefaultFetchSize();
+    } else {
+      this.fetchSize = fetchRows;
+    }
+  }

+
     if (getOpts().timeout > -1) {
       stmnt.setQueryTimeout(getOpts().timeout);
     }
     if (signalHandler != null) {
       signalHandler.setStatement(stmnt);
     }
+    if (fetchSize > -1) {
+      stmnt.setFetchSize(fetchSize);
+    }
{code}

# "-1" is an invalid value for fetch size, please make the default "0" so that 
it lines up with the JDBC specs.  The {{setFetchSize}} method makes sure the 
value is always valid.
# Remove the blank line change to minimize the patch
# Do not check for a valid fetchSize, just set it 
{{stmnt.setFetchSize(fetchSize);}}


was (Author: belugabehr):
{code:java|title=BeeLine.java}
+  public int fetchSize = -1;

+  public void setFetchSize(int fetchRows) {
+    if (fetchRows <= 0) { // if set to 0 or less, use server side default
+      this.fetchSize = Utils.getServerDefaultFetchSize();
+    } else {
+      this.fetchSize = fetchRows;
+    }
+  }

+
     if (getOpts().timeout > -1) {
       stmnt.setQueryTimeout(getOpts().timeout);
     }
     if (signalHandler != null) {
       signalHandler.setStatement(stmnt);
     }
+    if (fetchSize > -1) {
+      stmnt.setFetchSize(fetchSize);
+    }
{code}

# "-1" is an invalid value for fetch size, please make the default "0" so that 
it lines up with the JDBC specs.  The {{setFetchSize}} method makes sure the 
value is always valid.
# Remove the blank line change to minimize the patch
# Do not check for a valid fetchSize, just set it 
{{stmnt.setFetchSize(fetchSize);}}}

> Beeline should use HS2 server defaults for fetchSize
> ----------------------------------------------------
>
>                 Key: HIVE-22853
>                 URL: https://issues.apache.org/jira/browse/HIVE-22853
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 4.0.0
>            Reporter: Naveen Gangam
>            Assignee: Naveen Gangam
>            Priority: Major
>         Attachments: HIVE-22853.2.patch, HIVE-22853.3.patch, 
> HIVE-22853.4.patch, HIVE-22853.5.patch, HIVE-22853.patch
>
>
> Currently beeline uses a hard coded default of 1000 rows for fetchSize. This 
> default value is different from what the server has set. While the beeline 
> user can reset the value via set command, its cumbersome to change the 
> workloads.
> Rather it should default to the server-side value and set should be used to 
> override within the session.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to