Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-898

Type of 'Java<Long> * INTEGER' should be BIGINT

Rank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersConvert to sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • None
    • None

    Description

      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.

      select EMPNO * 3 as EMPNO from EMPS where EMPNO = 100
      
      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)
      

      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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            julianhyde Julian Hyde
            janvanbesien Jan Van Besien
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment