Cassandra driver exception for timestamp
Hi
I am trying to connect rapidminer to cassandra 3.1 and I believe I have found a bug. I am using manual queries to test the connection. Most of the queries work OK but reading any timestamp throws an exception.
Cassandra driver Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]
(full stack trace and example table below)
This problem appears to be related to the issue https://datastax-oss.atlassian.net/browse/JAVA-1176 where the Cassandra driver has changed the method calls for timestamps but rapidminer is still using the old method. ( On a related note, it would be very useful if we could inject our own custom codecs for cassandra https://docs.datastax.com/en/developer/java-driver/3.3/manual/custom_codecs/ which would allow developers to better handle custom data types injected into cassandra databases).
Suggested work arounds welcome
Full details follow:
My cassandra table is defined as;
CREATE TABLE $KEYSPACE$.samples (
context text,
partition int,
resource text,
collected_at timestamp,
metric_name text,
value blob,
attributes map<text, text>,
PRIMARY KEY((context, partition, resource), collected_at, metric_name)
);
I can perform a query which works OK for most columns in the table. e.g.
select context, partition, resource, metric_name from samples;
but if I try to select the timestamp using
select collected_at from samples;
rapidminer throws the following exception
Exception: com.rapidminer.operator.OperatorException
Message: Unknown error. Something went wrong.
Stack trace:
com.rapidminer.extension.nosql.operator.cassandra.ReadCassandraOperator.createExampleSet(ReadCassandraOperator.java:112)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:49)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:33)
com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:126)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:77)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:812)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:807)
java.security.AccessController.doPrivileged(Native Method)
com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:807)
com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:428)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.Process.execute(Process.java:1310)
com.rapidminer.Process.run(Process.java:1285)
com.rapidminer.Process.run(Process.java:1176)
com.rapidminer.Process.run(Process.java:1129)
com.rapidminer.Process.run(Process.java:1124)
com.rapidminer.Process.run(Process.java:1114)
com.rapidminer.gui.ProcessThread.run(ProcessThread.java:65)
Cause
Exception: com.datastax.driver.core.exceptions.CodecNotFoundException
Message: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]
Stack trace:
com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:741)
com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:588)
com.datastax.driver.core.CodecRegistry.access$500(CodecRegistry.java:137)
com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:246)
com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:232)
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3542)
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2323)
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2286)
com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
com.google.common.cache.LocalCache.get(LocalCache.java:3953)
com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3957)
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4875)
com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:522)
com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:485)
com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:467)
com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:69)
com.datastax.driver.core.AbstractGettableByIndexData.getDate(AbstractGettableByIndexData.java:174)
com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:26)
com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:111)
com.rapidminer.extension.nosql.operator.cassandra.ReadCassandraOperator.createExampleSet(ReadCassandraOperator.java:162)
com.rapidminer.extension.nosql.operator.cassandra.ReadCassandraOperator.createExampleSet(ReadCassandraOperator.java:97)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:49)
com.rapidminer.operator.io.AbstractExampleSource.read(AbstractExampleSource.java:33)
com.rapidminer.operator.io.AbstractReader.doWork(AbstractReader.java:126)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.operator.execution.SimpleUnitExecutor.execute(SimpleUnitExecutor.java:77)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:812)
com.rapidminer.operator.ExecutionUnit$3.run(ExecutionUnit.java:807)
java.security.AccessController.doPrivileged(Native Method)
com.rapidminer.operator.ExecutionUnit.execute(ExecutionUnit.java:807)
com.rapidminer.operator.OperatorChain.doWork(OperatorChain.java:428)
com.rapidminer.operator.Operator.execute(Operator.java:1004)
com.rapidminer.Process.execute(Process.java:1310)
com.rapidminer.Process.run(Process.java:1285)
com.rapidminer.Process.run(Process.java:1176)
com.rapidminer.Process.run(Process.java:1129)
com.rapidminer.Process.run(Process.java:1124)
com.rapidminer.Process.run(Process.java:1114)
com.rapidminer.gui.ProcessThread.run(ProcessThread.java:65)
Comments
Hi,
thanks for bringing this to our attention. This is unfortunately indeed the old way of reading those timestamp columns which no longer works for newer Cassandra versions. I created an internal ticket for it.
Regards,
Marco
thanks very much for this bug report. Will follow up with updates from here.
We have a fix for this issue in the pipeline. It should be ready within a week, but don't quote me on that
We will release the update for the extension on the marketplace once it is ready.
The new version 8.2 of the NoSQL extension has been uploaded to the Marketplace. It will go live tomorrow, together with RapidMiner Studio 8.2.