Skip to content

GH-3900: Replace Guava with JDK APIs in parquet-cli - #3906

Merged
Fokko merged 1 commit into
apache:masterfrom
Fokko:jdk17-cli-reduce-guava
Oct 29, 2026
Merged

Fokko merged 1 commit into
apache:masterfrom
Fokko:jdk17-cli-reduce-guava

Conversation

@Fokko

@Fokko Fokko commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Most of parquet-cli's Guava usage has a direct JDK 17 equivalent.

What changes are included in this PR?

  • Lists / Maps / Sets factories become JDK constructors. Immutable* becomes List / Set / Map.of / copyOf, only where the collection is never iterated for output or never holds nulls; ordered output keeps LinkedHashMap.
  • Joiner / Splitter become String.join / String.split(..., -1). MoreObjects / Objects become java.util.Objects or a plain toString.
  • Guava's Preconditions becomes org.apache.parquet.Preconditions / Objects.requireNonNull.
  • Guava imports in parquet-cli/src/main go from 85 to 15. The kept ones have no clean JDK equivalent: Closeables.close(x, threw), CharMatcher, Ascii, HashCode, CharStreams, Resources, Iterators.transform and VisibleForTesting.

Are these changes tested?

Covered by the existing parquet-cli test suite.

Are there any user-facing changes?

No.

Closes #3900

This pull request and its description were written by Isaac.

Now that the minimum JDK is 17, replace Guava collection factories,
ImmutableList/ImmutableSet/ImmutableMap, Joiner, Splitter, Objects,
MoreObjects and simple Iterables/Predicate/Function usages in
parquet-cli with JDK equivalents, and switch Guava Preconditions to
org.apache.parquet.Preconditions (all call sites use %s-only messages
with matching argument counts) and Objects.requireNonNull.

Guava usages without a clean JDK equivalent are kept: Closeables,
CharMatcher, Ascii, HashCode, CharStreams, Resources, Iterators.transform
and VisibleForTesting.

Co-authored-by: Isaac <no-reply@databricks.com>
@Fokko
Fokko merged commit ea06dbd into apache:master Oct 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Guava with JDK APIs in parquet-cli

2 participants