SNOW-931105: NoSuchMethodError when using snowflake-ingest-sdk 2.0.3
Closed this issue · 1 comments
We are trying to upgrade the JDBC driver from 3.13.33 to 3.14.2, but the newer version no longer works with snowflake-ingest-sdk 2.0.3. The driver seems to have evolved in a backward-incompatible way.
I would like to ask for an additional overload of the createSessionlessTelemetry method, so the snowflake-ingest-sdk is able to work correctly with the latest version of the driver.
Proposal of the additional overload:
public static Telemetry createSessionlessTelemetry(
CloseableHttpClient httpClient, String serverUrl) {
return createSessionlessTelemetry(httpClient, serverUrl, "KEYPAIR_JWT", DEFAULT_FORCE_FLUSH_SIZE);
}
1. What version of JDBC driver are you using?
3.14.2 (but temporarily forced to use 3.13.33 because of the error)
2. What operating system and processor architecture are you using?
Linux thinkpad 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 x86_64 GNU/Linux
3. What version of Java are you using?
openjdk version "17.0.6" 2023-01-17
OpenJDK Runtime Environment GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13)
OpenJDK 64-Bit Server VM GraalVM CE 22.3.1 (build 17.0.6+10-jvmci-22.3-b13, mixed mode, sharing)
4. What did you do?
Tried to call net.snowflake.ingest.SimpleIngestManager.<init>(SimpleIngestManager.java:364)
with snowflake-ingest-sdk 2.0.3 and snowflake-jdbc 3.14.2
using parameters that worked with snowflake-ingest-sdk 2.0.3 and snowflake-jdbc 3.13.33.
For easy reproduction, use these libraries and write a main method containing:
new net.snowflake.ingest.SimpleIngestManager("", "", "", new java.security.KeyPair(null, null));
In the JDBC driver version 3.13.33 and lower, it worked fine. In versions 3.14.x it throws the following error:
java.lang.NoSuchMethodError: 'net.snowflake.client.jdbc.telemetry.Telemetry net.snowflake.client.jdbc.telemetry.TelemetryClient.createSessionlessTelemetry(net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient, java.lang.String)'
at net.snowflake.ingest.connection.TelemetryService.<init>(TelemetryService.java:68)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:271)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:196)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:174)
at net.snowflake.ingest.SimpleIngestManager.<init>(SimpleIngestManager.java:364)
5. What did you expect to see?
I expected that neither an exception nor an error is thrown.
6. Can you set logging to DEBUG and collect the logs?
Unfortunately, I'm prevented from doing so by an exception that gets thrown (as follows):
java.lang.NoSuchMethodError: 'net.snowflake.client.jdbc.telemetry.Telemetry net.snowflake.client.jdbc.telemetry.TelemetryClient.createSessionlessTelemetry(net.snowflake.client.jdbc.internal.apache.http.impl.client.CloseableHttpClient, java.lang.String)'
at net.snowflake.ingest.connection.TelemetryService.<init>(TelemetryService.java:68)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:271)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:196)
at net.snowflake.ingest.connection.RequestBuilder.<init>(RequestBuilder.java:174)
at net.snowflake.ingest.SimpleIngestManager.<init>(SimpleIngestManager.java:364)
which is caused by the fact, that the TelemetryService from snowflake-ingest 2.0.3 requires the createSessionlessTelemetry
to accept 2 (not 3) parameters: https://github.com/snowflakedb/snowflake-ingest-java/blob/v2.0.3/src/main/java/net/snowflake/ingest/connection/TelemetryService.java#L68
7. What is your Snowflake account identifier, if any? (Optional)
@przemek-pokrywka Thanks for reporting issue. I found the PR causing this issue. Just for your reference: #1418. We will make the change as you suggested.