Uploaded image for project: 'Spring Data for Apache Cassandra'
  1. Spring Data for Apache Cassandra
  2. DATACASS-199

ColumnMapper maps varint to Integer

    XMLWordPrintable

    Details

    • Last commented by a User:
      true

      Description

      BigInteger columns map to varint in Cassandra. ColumnReader attempts to read varint columns back as Integers, which throws an exception.

      I have submitted a pull request with a test for this condition and a fix. Stack trace on failure follows:

      testQueryWithReference(org.springframework.data.cassandra.test.integration.querymethods.bigintparam.BigIntParamIntegrationTests) Time elapsed: 0.212 sec <<< ERROR!
      com.datastax.driver.core.exceptions.InvalidTypeException: Value number is of type varint
      at com.datastax.driver.core.AbstractGettableByIndexData.checkType(AbstractGettableByIndexData.java:73)
      at com.datastax.driver.core.AbstractGettableByIndexData.getInt(AbstractGettableByIndexData.java:119)
      at com.datastax.driver.core.AbstractGettableData.getInt(AbstractGettableData.java:24)
      at org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:71)
      at org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:38)
      at org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:30)
      at org.springframework.data.cassandra.convert.BasicCassandraRowValueProvider.getPropertyValue(BasicCassandraRowValueProvider.java:64)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter.readPropertyFromRow(MappingCassandraConverter.java:186)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter$1.doWithPersistentProperty(MappingCassandraConverter.java:150)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter$1.doWithPersistentProperty(MappingCassandraConverter.java:145)
      at org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:309)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter.readPropertiesFromRow(MappingCassandraConverter.java:145)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter.readEntityFromRow(MappingCassandraConverter.java:137)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter.readRow(MappingCassandraConverter.java:114)
      at org.springframework.data.cassandra.convert.MappingCassandraConverter.read(MappingCassandraConverter.java:202)
      at org.springframework.data.cassandra.repository.query.AbstractCassandraQuery.getSingleEntity(AbstractCassandraQuery.java:176)
      at org.springframework.data.cassandra.repository.query.AbstractCassandraQuery.execute(AbstractCassandraQuery.java:133)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:395)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:373)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy52.findThingByBigInteger(Unknown Source)
      at org.springframework.data.cassandra.test.integration.querymethods.bigintparam.BigIntParamIntegrationTests.testQueryWithReference(BigIntParamIntegrationTests.java:45)

        Attachments

          Activity

            People

            Assignee:
            dwebb David Webb
            Reporter:
            petercable Peter Cable
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 21 weeks, 1 day ago