[
https://issues.apache.org/jira/browse/CALCITE-647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14485465#comment-14485465
]
Julian Hyde commented on CALCITE-647:
-------------------------------------
When sending parameters the server doesn't know the exact type they sent. So my
solution uses TypedValue.
When returning column values the client has already been told the exact type of
the column and the representation that will be used. My solution just returns
column values. For example, if it is a BINARY column the client knows that it
will be a Base64 string and uses a BinaryFromStringAccessor.
Can you try rebasing your test cases onto my
https://github.com/julianhyde/incubator-calcite/tree/671-byte-string. If they
work we can declare this issue fixed.
I also like your idea of using Jackson Base64Variants rather than including a
Base64 implementation in Avatica.
> Avatica cursor type cast for number cause exception in AvaticaResultSet
> -----------------------------------------------------------------------
>
> Key: CALCITE-647
> URL: https://issues.apache.org/jira/browse/CALCITE-647
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.1.0-incubating
> Reporter: Xavier FH Leong
> Assignee: Julian Hyde
> Labels: avatica
> Attachments: CALCITE-647-binary-codec-02.patch,
> CALCITE-647-cursor-numberTypeCast.patch
>
>
> After the result are deserialized from JSON on remote side, the object is not
> with it's original type, forcing casing of box type Long on Integer raise
> exception.
> For all box number, it will type cast to Number and extract using the Number
> method instead.
> 2015-03-26 15:49:48,154 [Thread-10] ERROR
> net.sourceforge.squirrel_sql.fw.sql.ResultSetReader - Error reading column
> data, column index = 3
> java.lang.ClassCastException: java.lang.Integer incompatible with
> java.lang.Long
> at
> org.apache.calcite.avatica.util.AbstractCursor$LongAccessor.getLong(AbstractCursor.java:483)
> at
> org.apache.calcite.avatica.AvaticaResultSet.getLong(AvaticaResultSet.java:252)
> at
> net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.DataTypeLong.readResultSet(DataTypeLong.java:365)
> at
> net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.CellComponentFactory.readResultSet(CellComponentFactory.java:488)
> at
> net.sourceforge.squirrel_sql.fw.sql.ResultSetReader.doContentTabRead(ResultSetReader.java:613)
> at
> net.sourceforge.squirrel_sql.fw.sql.ResultSetReader.readRow(ResultSetReader.java:184)
> at
> net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet.createRow(ResultSetDataSet.java:237)
> at
> net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet._setResultSet(ResultSetDataSet.java:203)
> at
> net.sourceforge.squirrel_sql.fw.datasetviewer.ResultSetDataSet.setSqlExecutionTabResultSet(ResultSetDataSet.java:126)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.SQLExecutionHandler.sqlResultSetAvailable(SQLExecutionHandler.java:410)
> at
> net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processResultSet(SQLExecuterTask.java:542)
> at
> net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.processQuery(SQLExecuterTask.java:407)
> at
> net.sourceforge.squirrel_sql.client.session.SQLExecuterTask.run(SQLExecuterTask.java:205)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:853)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)