You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using Guava library for a few things. However it creates some issues at runtime. This is can be handled by using shaded version but may be we can improve something.
Here is copy of the comment with information about the problem (#2816 (comment)):
Great thank you!
Just another note about running on Spark 3, JDK 8: spark dustribution depend on older version of guava - guava-27.0-jre.jar.
The clickhouse-java uses just few methods from this library newer version, e.g. ImmutableMap.builder.buildKeepingLast in com.clickhouse.client.api.metadata.TableSchema (there is a user suggestion to get rid of guava at all :) )
So clickhouse-java version 0.9.x usage still impossible on Spark 3, JDK 8 - exception due to buildKeepingLast is missing. Using newer guava as a classpath library with user's spark job is dangerous, cause Spark itself rely on older version.
I'd like to suggest a change - incorporate a method from recent guava into clickhouse-java, this way clickhouse-java could rely/depend on guava 27 and would be capable to run on Spark 3, JDK8.
The method to borrow is ImmutableMap#lastEntryForEachKey, the changed TableSchema is attached
Recommendation: Keep open — maintainer decision main still fails at run time with Guava 27, the version that the Spark 3 reporter has. The decision: keep Guava and use only methods that Guava 27 has, or remove Guava as sub-issue #2788 asks.
Status on main: Reproduced on main — with guava-27.0-jre in place of 33.7.2, the first Client.queryAll and the first DriverManager.getConnection throw NoSuchMethodError: ImmutableMap$Builder.buildKeepingLast(). With 33.7.2 both work. main8480ca001, ClickHouse 26.11.2.4.
Breaking change: No
Duplicates / related: No others
Workaround: The shaded clickhouse-jdbc-0.11.2-all.jar runs both calls with guava-27.0-jre on the classpath.
Analysis:ImmutableMap.Builder.buildKeepingLast() exists from Guava 31.0. client-v2 calls it in TableSchema.java:41, and jdbc-v2 calls it in the static initializer of JdbcConfiguration (JdbcConfiguration.java:78) and in ConnectionImpl.java:135. DatabaseMetaDataImpl.java:1542 calls buildOrThrow(), also from Guava 31.0.
Automated triage by Polyglot AI. A maintainer makes the final decision.
Activity
chernser commentedon Apr 17, 2026
Here is copy of the comment with information about the problem (#2816 (comment)):
polyglotAI-bot commentedon Nov 27, 2026
Recommendation: Keep open — maintainer decision
mainstill fails at run time with Guava 27, the version that the Spark 3 reporter has. The decision: keep Guava and use only methods that Guava 27 has, or remove Guava as sub-issue #2788 asks.main: Reproduced on main — withguava-27.0-jrein place of 33.7.2, the firstClient.queryAlland the firstDriverManager.getConnectionthrowNoSuchMethodError: ImmutableMap$Builder.buildKeepingLast(). With 33.7.2 both work.main8480ca001, ClickHouse 26.11.2.4.clickhouse-jdbc-0.11.2-all.jarruns both calls withguava-27.0-jreon the classpath.Analysis:
ImmutableMap.Builder.buildKeepingLast()exists from Guava 31.0. client-v2 calls it inTableSchema.java:41, and jdbc-v2 calls it in the static initializer ofJdbcConfiguration(JdbcConfiguration.java:78) and inConnectionImpl.java:135.DatabaseMetaDataImpl.java:1542callsbuildOrThrow(), also from Guava 31.0.Automated triage by Polyglot AI. A maintainer makes the final decision.