3 Replies Latest reply on Apr 9, 2019 4:00 PM by shawkins

    timestamp fields fetch error with Cassandra

    mtawk

      I am getting the below error when fetching a Cassandra table containing a column of type timestamp

       

      ERROR TEIID_CONNECTOR_LOGGER:92 (Worker1_QueryProcessorQueue117) -  - [Connector worker process failed for atomic-request=bioF/LJOq1Ih.5.0.84] -

      com.datastax.driver.core.exceptions.CodecNotFoundException: Codec not found for requested operation: [timestamp <-> com.datastax.driver.core.LocalDate]

      at com.datastax.driver.core.CodecRegistry.notFound(CodecRegistry.java:741)

      at com.datastax.driver.core.CodecRegistry.createCodec(CodecRegistry.java:588)

      at com.datastax.driver.core.CodecRegistry.access$500(CodecRegistry.java:137)

      at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:246)

      at com.datastax.driver.core.CodecRegistry$TypeCodecCacheLoader.load(CodecRegistry.java:232)

      at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3529)

      at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2278)

      at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2156)

      at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2046)

      at com.google.common.cache.LocalCache.get(LocalCache.java:3948)

      at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3972)

      at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4957)

      at com.datastax.driver.core.CodecRegistry.lookupCodec(CodecRegistry.java:522)

      at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:485)

      at com.datastax.driver.core.CodecRegistry.codecFor(CodecRegistry.java:467)

      at com.datastax.driver.core.AbstractGettableByIndexData.codecFor(AbstractGettableByIndexData.java:69)

      at com.datastax.driver.core.AbstractGettableByIndexData.getDate(AbstractGettableByIndexData.java:174)

      at com.datastax.driver.core.AbstractGettableData.getDate(AbstractGettableData.java:26)

      at org.teiid.translator.cassandra.CassandraQueryExecution.getRow(CassandraQueryExecution.java:161)

      at org.teiid.translator.cassandra.CassandraQueryExecution.next(CassandraQueryExecution.java:100)

      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:428)

      at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:231)

      at sun.reflect.GeneratedMethodAccessor624.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:216)

      at com.sun.proxy.$Proxy61.more(Unknown Source)

      at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:305)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)

      at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:104)

      at java.util.concurrent.FutureTask.run(Unknown Source)

      at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:61)

      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)

       

      The issue is solved in CassandraQueryExecution.java when replacing

                case TIMESTAMP:

                     values.add(row.getDate(i));

      with

                case TIMESTAMP:

                     values.add(row.getTimestamp(i));