Skip to content

[client-v2] Guava library #2831

Open
0 of 1 issue completed
Open

Description

@chernser

Description

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.

Sub-issues

Sub-issues

0 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added theissue type on Apr 17, 2026
  2. added
    environment
    on Apr 17, 2026
  3. chernser commented on Apr 17, 2026

    @chernser
    ContributorAuthor

    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
    
  4. added this to the 0.11.0 milestone on Jun 24, 2026
  5. modified the milestones: 0.11.0, 0.12.0 on Sep 23, 2026
  6. removed this from the 0.12.0 milestone on Oct 14, 2026
  7. polyglotAI-bot commented on Nov 27, 2026

    @polyglotAI-bot
    Collaborator

    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.

    • Category: Other
    • Classification: impact: none · area: Environment (Guava 27, Spark 3)
    • 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. main 8480ca001, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    environment

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions