Skip to content

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

Open
Fokko wants to merge 1 commit into
apache:masterfrom
Fokko:jdk17-cli-reduce-guava
Open

Fokko wants to merge 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 <[email protected]>
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