[ 
https://issues.apache.org/jira/browse/CALCITE-2322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stamatis Zampetakis resolved CALCITE-2322.
------------------------------------------
    Resolution: Fixed

Fixed in 
https://github.com/apache/calcite-avatica/commit/5047b566d139fb9c4c691ccda3e5c18e15fc621f.
 Thanks to the many reviewers and [~kminder] and [~zacMode] for the PRs.

I was a bit reluctant to merge the PR cause this is a new feature and there 
were no tests added.

Moreover, it seems that there is a small bug with respect to the JDK API: 
https://docs.oracle.com/en/java/javase/18/docs/api/java.sql/java/sql/Statement.html#setFetchSize(int)
If someone sets the fetch size to zero I get the impression that with the PR in 
place we will not fetch anything from the server while we should just ignore 
the hint if my understanding is correct.

I decided to push it nevertheless since it has been approved by various people 
already so I didn't want to stall things for much longer.

I will log follow-up tickets for the remaining work and hopefully we can 
resolve them for the next release. 


> Add fetch size support to connection url and JDBC statement
> -----------------------------------------------------------
>
>                 Key: CALCITE-2322
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2322
>             Project: Calcite
>          Issue Type: Improvement
>          Components: avatica, core
>    Affects Versions: 1.11.0
>            Reporter: Kevin Minder
>            Priority: Major
>             Fix For: avatica-1.23.0
>
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> Currently the remote driver defaults to hard coded fetch size of 100 rows.  
> When a connection is operating in HTTP mode having such a small fetch size 
> can add enormous overhead.  This is especially true if TLS connections are 
> used and made worse if each connection flows throw multiple proxies.  
> Consider that 100K rows returned 100 rows at a time will make 1K HTTP POST 
> requests.  One might say that nobody should ever do that but some tools like 
> Spotfire may end up doing this.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to