Hi, I’m trying to use the Cassandra sink (`flink-c...
# troubleshooting
m
Hi, I’m trying to use the Cassandra sink (
flink-connector-cassandra_2.12
) but my pipeline gets stuck after the first object is written into Cassandra. Upon using the debugger, I discovered that the following exception is thrown:
Copy code
java.lang.IncompatibleClassChangeError: Class com.datastax.driver.core.DefaultResultSetFuture does not implement the requested interface org.apache.flink.cassandra.shaded.com.google.common.util.concurrent.ListenableFuture
I am using flink version
1.16.0
and the datastax driver (
com.datastax.cassandra
) version
3.11.4
. Any idea why this is happening / how to fix this?
a
Hi, are you adding datastax driver alongside connector? This looks like an issue with shading in the connector jar. Connector jar already includes datastax driver code which depends on relocated version of guava. Can you try to remove datastax driver from your pom and use one shipped within connector jar?
m
Hi, I didn’t include the core driver as a direct dependency. However, I added
cassandra-driver-extras
as I want to use some of the extra codecs. I realised that this dependency also pulls in the core driver, so I fixed the above exception by excluding core as follos:
Copy code
<dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>cassandra-driver-extras</artifactId>
    <version>3.11.2</version>
    <exclusions>
        <exclusion>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
        </exclusion>
    </exclusions>
</dependency>
That fixed the initial exception. However, I now have a new issue with using
com.datastax.driver.extras.codecs.enums.EnumNameCodec
. I am getting the following exception:
Copy code
java.lang.NoSuchMethodError: 'void com.datastax.driver.core.TypeCodec.<init>(com.datastax.driver.core.DataType, com.google.common.reflect.TypeToken)'
	at com.datastax.driver.extras.codecs.ParsingCodec.<init>(ParsingCodec.java:55)
	at com.datastax.driver.extras.codecs.ParsingCodec.<init>(ParsingCodec.java:51)
	at com.datastax.driver.extras.codecs.enums.EnumNameCodec.<init>(EnumNameCodec.java:39)
	at com.datastax.driver.extras.codecs.enums.EnumNameCodec.<init>(EnumNameCodec.java:35)
I noticed that
TypeCodec
is part of core whereas
ParsingCodec
is part of extras. Could this be caused by a version mismatch? How can I find out what core version the connector includes?
a
Could this be caused by a version mismatch?
I suspect that this is also due to relocated guava in the connector - method signature will change to
void com.datastax.driver.core.TypeCodec.<init>(com.datastax.driver.core.DataType, <http://org.apache.flink.cassandra.shaded.com|org.apache.flink.cassandra.shaded.com>.google.common.reflect.TypeToken)
(notice change in fully classified name of the second parameter type). Based on this, I’m not sure how to use
cassandra-driver-extras
with this connector. Maybe someone more closely familiar with cassandra connector can help here.
m
Thanks, I am adding version 3.11.2 of the driver extras so it’s the same version as the core driver. @Martijn Visser do you know how to use the extras with the connector?
m
I don’t