Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColumnMapper maps varint to Integer [DATACASS-199] #369

Closed
spring-projects-issues opened this issue Jan 26, 2015 · 1 comment
Closed

ColumnMapper maps varint to Integer [DATACASS-199] #369

spring-projects-issues opened this issue Jan 26, 2015 · 1 comment

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jan 26, 2015

Peter Cable opened DATACASS-199 and commented

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)


Affects: 1.0.4 (Dijkstra SR4), 1.1.1 (Evans SR1), 1.2 M1 (Fowler)

Referenced from: commits 4491f31

Backported to: 1.1.2 (Evans SR2)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jan 27, 2015

David Webb commented

Pull request merged and all test passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant