com.datastax.driver.core.exceptions.InvalidTypeException: Value number is of type varint

Spring JIRA | Peter Cable | 2 years ago
  1. 0

    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)

    Spring JIRA | 2 years ago | Peter Cable
    com.datastax.driver.core.exceptions.InvalidTypeException: Value number is of type varint
  2. 0

    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)

    Spring JIRA | 2 years ago | Peter Cable
    com.datastax.driver.core.exceptions.InvalidTypeException: Value number is of type varint
  3. 0

    DataStax Java Driver -- getDate does not return a timestamp

    Stack Overflow | 1 year ago | Brad Gawne
    com.datastax.driver.core.exceptions.InvalidTypeException: Value accountExpiryDate is of type timestamp
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Can't retrieve by UDT key from cassandra with datastax java driver

    Stack Overflow | 1 year ago | NullProgrammerException
    com.datastax.driver.core.exceptions.InvalidTypeException: Invalid value for CQL type frozen<example_keyspace.my_data_type>, expecting class com.datastax.driver.core.UDTValue but class me.example.Main$MyDataType provided

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.datastax.driver.core.exceptions.InvalidTypeException

      Value number is of type varint

      at com.datastax.driver.core.AbstractGettableByIndexData.checkType()
    2. DataStax Java Driver for Apache Cassandra - Core
      AbstractGettableData.getInt
      1. com.datastax.driver.core.AbstractGettableByIndexData.checkType(AbstractGettableByIndexData.java:73)
      2. com.datastax.driver.core.AbstractGettableByIndexData.getInt(AbstractGettableByIndexData.java:119)
      3. com.datastax.driver.core.AbstractGettableData.getInt(AbstractGettableData.java:24)
      3 frames
    3. Spring Data Cassandra - Core
      MappingCassandraConverter$1.doWithPersistentProperty
      1. org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:71)
      2. org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:38)
      3. org.springframework.data.cassandra.convert.ColumnReader.get(ColumnReader.java:30)
      4. org.springframework.data.cassandra.convert.BasicCassandraRowValueProvider.getPropertyValue(BasicCassandraRowValueProvider.java:64)
      5. org.springframework.data.cassandra.convert.MappingCassandraConverter.readPropertyFromRow(MappingCassandraConverter.java:186)
      6. org.springframework.data.cassandra.convert.MappingCassandraConverter$1.doWithPersistentProperty(MappingCassandraConverter.java:150)
      7. org.springframework.data.cassandra.convert.MappingCassandraConverter$1.doWithPersistentProperty(MappingCassandraConverter.java:145)
      7 frames
    4. Spring Data Core
      BasicPersistentEntity.doWithProperties
      1. org.springframework.data.mapping.model.BasicPersistentEntity.doWithProperties(BasicPersistentEntity.java:309)
      1 frame
    5. Spring Data Cassandra - Core
      AbstractCassandraQuery.execute
      1. org.springframework.data.cassandra.convert.MappingCassandraConverter.readPropertiesFromRow(MappingCassandraConverter.java:145)
      2. org.springframework.data.cassandra.convert.MappingCassandraConverter.readEntityFromRow(MappingCassandraConverter.java:137)
      3. org.springframework.data.cassandra.convert.MappingCassandraConverter.readRow(MappingCassandraConverter.java:114)
      4. org.springframework.data.cassandra.convert.MappingCassandraConverter.read(MappingCassandraConverter.java:202)
      5. org.springframework.data.cassandra.repository.query.AbstractCassandraQuery.getSingleEntity(AbstractCassandraQuery.java:176)
      6. org.springframework.data.cassandra.repository.query.AbstractCassandraQuery.execute(AbstractCassandraQuery.java:133)
      6 frames
    6. Spring Data Core
      RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke
      1. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:395)
      2. org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:373)
      2 frames
    7. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      2 frames
    8. com.sun.proxy
      $Proxy52.findThingByBigInteger
      1. com.sun.proxy.$Proxy52.findThingByBigInteger(Unknown Source)
      1 frame
    9. org.springframework.data
      BigIntParamIntegrationTests.testQueryWithReference
      1. org.springframework.data.cassandra.test.integration.querymethods.bigintparam.BigIntParamIntegrationTests.testQueryWithReference(BigIntParamIntegrationTests.java:45)
      1 frame