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

Gabriel Reid commented on PHOENIX-1404:
---------------------------------------

>From the [javadoc for 
>ResultSet#setFetchSize|http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html#setFetchSize(int)]:
{quote}
Gives the JDBC driver a hint as to the number of rows that should be fetched 
from the database when more rows are needed for this ResultSet object.
{quote}

Based on this (i.e. that it's just a hint to the driver), it sounds like it's 
definitely preferable to just ignore the call instead of throwing a 
SQLFeatureNotSupportedException.

As far as actually implementing setFetchSize to do something, it would indeed 
be possible to do something like changing the caching setting in new scans from 
within the ChunkedResultIterator. However, this will involve moving this 
setting to ResultSet scope (just as PHOENIX-1407 will require moving the 
setting to Statement scope). I'm not too convinced that this is worth the 
effort though. As you pointed out, the semantics of setFetchSize don't carry 
over to Phoenix very well. From what I understand, setFetchSize is typically 
called to set the number of rows per RPC call to a higher value (for example, 
the default value is 10 rows per RPC call in Oracle). I think this method is 
typically called somewhat blindly from within libraries (such as RJDBC), so my 
expectation is that actually implementing this might cause more problems than 
anything else.

In any case, I would suggest ignoring the setting for now. If anyone ever wants 
the fetch size setting to really be honored at some time in the future, we can 
do that once there's a real use case for it. Sound good [~giacomotaylor]?

> PhoenixResultSet.setFetchSize throws SQLFeatureNotSupportedException
> --------------------------------------------------------------------
>
>                 Key: PHOENIX-1404
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1404
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 5.0.0
>            Reporter: Josh Mahonin
>
> I've run into this issue when attempting to use Phoenix with both R Studio 
> (with RJDBC), as well as ElasticSearch
> Lots of libraries attempt a setFetchSize() on a JDBC result set, but very few 
> of them have error handling code, unfortunately. Rather than attempting to 
> patch each library, it would be nice if Phoenix could handle this call.
> Is it as simple as invoking "statement.setFetchSize()" in this method? 
> https://github.com/apache/phoenix/blob/4ed9ddb8fd28dffcd686671c18dc89d12b0a1c0c/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixResultSet.java#L784
> I suspect not, but if someone can take a quick look I can make the necessary 
> code change and submit a patch.
> Related to PHOENIX-1175



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to