You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2015/10/06 17:20:26 UTC

[jira] [Comment Edited] (CALCITE-871) JdbcResultSet returns incomplete Frame with "default" statement ID

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

Josh Elser edited comment on CALCITE-871 at 10/6/15 3:20 PM:
-------------------------------------------------------------

How about we just assign this issue to you then, [~bruno]. You've beat me to the punch  :)

edit: Hrm, it seems like you must not have the right JIRA karma to get assigned issues. Perhaps [~julianhyde] would rectify that for you.


was (Author: elserj):
How about we just assign this issue to you then, [~bruno]. You've beat me to the punch  :)

> JdbcResultSet returns incomplete Frame with "default" statement ID
> ------------------------------------------------------------------
>
>                 Key: CALCITE-871
>                 URL: https://issues.apache.org/jira/browse/CALCITE-871
>             Project: Calcite
>          Issue Type: Bug
>          Components: avatica
>    Affects Versions: 1.4.0-incubating
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>             Fix For: 1.5.0-incubating
>
>
> I noticed this case while playing around with sqlline, phoenix queryserver and avatica.
> When sqlline starts up, it, among other things, fetches the columns to do some autocompletion magic in its shell. I noticed that this was always resulting in an error in Avatica's code, saying that the statement id wasn't found (the "fake" one {{-1}})
> I traced through this and believe there's a problem with how JdbcResultSet computes the maximum size of results put into a Frame. For the calls which use this fake statement id (getColumns, getCatalogs, getTableTypes, etc), a result set returned by the wrapped JDBC driver which is larger than 100 results will cause a Frame to be sent back to the client which informs it to fetch another frame (via the {{done}} member).
> Concretely, if there are more than 100 columns to return in getColumns, the client will receive a Frame with {{done=false}} and 100 rows which will cause it to try to fetch another Frame of results. This will fail because we gave a fake statement ID which causes an exception in the server.
> As I see it, there are two solutions:
> # Create and cache a statement on these calls so that the fetch logic works as intended (the good solution)
> # Send all of the results back in one frame (the quick hacky thing I just tested).



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