Hello, I'm trying to flink work with clickhouse a...
# troubleshooting
y
Hello, I'm trying to flink work with clickhouse as a sink, and I keep getting :
Copy code
[ERROR] Could not execute SQL statement. Reason:
java.lang.NoSuchMethodError: 'com.clickhouse.jdbc.ClickHouseConnection com.clickhouse.jdbc.ClickHouseDriver.connect(java.lang.String, java.util.Properties)'
I have jdbc driver installed. Still...
p
Do you get this only on runtime and not when looking to the code? The runtime version may be different. How are you generating your at jar?
y
Hi Perdo... So, I'm deploying SQLs, via sql-client. I get that error when I run my insert, so after creating the source and sink tables. I create my own docker image using:
Copy code
RUN curl -L -o /opt/flink/lib/flink-connector-kafka-1.20.jar https://dp-assets-public.s3.us-east-1.amazonaws.com/flink-connector-kafka-3.4.0.jar
RUN curl -L -o /opt/flink/lib/kafka-clients-3.4.0.jar https://repo.maven.apache.org/maven2/org/apache/kafka/kafka-clients/3.4.0/kafka-clients-3.4.0.jar
RUN curl -L -o /opt/flink/lib/clickhouse-client-0.8.1.jar https://repo1.maven.org/maven2/com/clickhouse/clickhouse-client/0.8.1/clickhouse-client-0.8.1.jar
RUN curl -L -o /opt/flink/lib/clickhouse-data-0.8.1.jar https://repo1.maven.org/maven2/com/clickhouse/clickhouse-data/0.8.1/clickhouse-data-0.8.1.jar
RUN curl -L -o /opt/flink/lib/clickhouse-http-client-0.8.1.jar https://repo1.maven.org/maven2/com/clickhouse/clickhouse-http-client/0.8.1/clickhouse-http-client-0.8.1.jar
RUN curl -L -o /opt/flink/lib/clickhouse-jdbc-0.8.1.jar https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc/0.8.1/clickhouse-jdbc-0.8.1.jar
RUN curl -L -o /opt/flink/lib/jdbc-v2-0.8.1.jar https://repo1.maven.org/maven2/com/clickhouse/jdbc-v2/0.8.1/jdbc-v2-0.8.1.jar
I also build the flink-connector-clickhouse-1.0.0-SNAPSHOT.jar from https://github.com/itinycheng/flink-connector-clickhouse
I hae some errors before about missing jars, which I fixed, now I get that own, which seems to be related to jars dynamic loading (Not a java expert)
p
So there is a chance of the required flink jdbc jar not being the same as you're providing. I'm trying to find which version is used on Flink
If you're using this connector, they rely on version
0.6.4
but yours rely on
0.8.1
y
k, I'll downgrade 🙂 Thanks
That worked... Mind you I'm still missing some other jars... But thank you again for putting on the right track 🙂 I feel a bit d*** running in circle when it's this simple
p
Oh man. I'm glad it helped and I'm sorry about the pain. The loophole on dependencies is massive. Robin Moffatt wrote a really nice blog post about this. It may help. Here's the link
y
I know, did watch that video... I'm usually able to find my way, for some reason, this time I got tunnel vision I would say 🙂
p
That's why communities are good. If you find yourself struggling, share here. Let's cry together hahah
gratitude thank you 1