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

Naveen Gangam edited comment on HIVE-22853 at 2/28/20 9:20 PM:
---------------------------------------------------------------

New patch uploaded with some feedback from reviewers.

1) fetchsize = 0 should indicate to the client to use server side default.
To meet this requirement, I had to make a server side code change as well. So 
the client sends its initial fetch size, set in JDBC URL or 0 otherwise as part 
of the OpenSession request. This value is set in session's config map. The 
server then responds with its configured fetch size using the same config key. 
(it felt unnecessary to add a new config property just for the response, or an 
undocumented key for the server side response). Instead I felt this would be 
cleaner.
The client then save this server side value into a local variable, to be used 
whenever the client sets the fetch size to 0 or less than 0.

2) Setting a negative value for fetch size should throw an exception. The JDBC 
code does this currently. Throws a SQL exception. Uses the server side default 
on future statements.
Beeline behavior is bit different. It does not indicate any issues with setting 
the negative value. This behavior made the most sense because we do not 
validate the values for other config properties set via beeline. I feel we 
should be consistent here. But it uses the server side default value until it 
has been reset.
There was a lot of back and forth on whether we should ignore this set command 
entirely and only set it for positive values. The difference being, when you 
ignore the negative value set, we are using the last legally set value as 
opposed to the default.

3) Also switched to using a regex for more robustness with the set command with 
extra spaces in different part of the key/value.
[~belugabehr] [~ychena] does this make sense? Could you please re-review?



was (Author: ngangam):
New patch uploaded with some feedback from reviewers.

1) fetchsize = 0 should indicate to the client to use server side default.
To meet this requirement, I had to make a server side code change as well. So 
the client sends its initial fetch size, set in JDBC URL or 0 otherwise as part 
of the OpenSession request. This value is set in session's config map. The 
server then responds with its configured fetch size using the same config key. 
(it felt unnecessary to add a new config property just for the response, or an 
undocumented key for the server side response). Instead I felt this would be 
cleaner.
The client then save this server side value into a local variable, to be used 
whenever the client sets the fetch size to 0 or less than 0.

2) Setting a negative value for fetch size should throw an exception. The JDBC 
code does this currently. Throws a SQL exception. Uses the server side default 
on future statements.
Beeline behavior is bit different. It does not indicate any issues with setting 
the negative value. This behavior made the most sense because we do not 
validate the values for other config properties set via beeline. I feel we 
should be consistent here. But it uses the server side default value until it 
has been reset.
There was a lot of back and forth on whether we should ignore this set command 
entirely and only set it for positive values. The difference being, when you 
ignore the negative value set, we are using the last legally set value as 
opposed to the default.

[~belugabehr] [~ychena] does this make sense? Could you please re-review?


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