You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2015/09/29 19:53:04 UTC

[jira] [Resolved] (CALCITE-898) Type of 'Java * INTEGER' should be BIGINT

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

Julian Hyde resolved CALCITE-898.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.5.0-incubating

Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/0cb2e275.

> Type of 'Java<Long> * INTEGER' should be BIGINT
> -----------------------------------------------
>
>                 Key: CALCITE-898
>                 URL: https://issues.apache.org/jira/browse/CALCITE-898
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jan Van Besien
>            Assignee: Julian Hyde
>             Fix For: 1.5.0-incubating
>
>         Attachments: 0001-CALCITE-898-test-to-reproduce-the-issue.patch
>
>
> As discussed on the mailinglist, there seems to be a bug related to unexpected casting of Long to Integer.
> Queries such as these result in a ClassCastException.
> {code}
> select EMPNO * 3 as EMPNO from EMPS where EMPNO = 100
> {code}
> {code}
> java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
> 	at org.apache.calcite.avatica.util.AbstractCursor$IntAccessor.getInt(AbstractCursor.java:485)
> 	at org.apache.calcite.avatica.AvaticaSite.get(AvaticaSite.java:338)
> 	at org.apache.calcite.avatica.AvaticaResultSet.getObject(AvaticaResultSet.java:381)
> {code}
> I was able to reproduce the problem with the CsvTest, see attached patch. Note that, in the patch, I changed the datatype of EMPNO from int to long and that I use resultSet.getObject in stead of resultSet.getString to output the result set. With getString it works because it doesn't try to cast the Long to an Integer first.



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