Skip to content

GH-4006: Remove fastutil dependency from parquet-hadoop - #4007

Merged
Fokko merged 1 commit into
apache:masterfrom
jerolba:GH-4006_remove_fastutil_dependency_from_parquet_hadoop
Nov 30, 2026
Merged

Fokko merged 1 commit into
apache:masterfrom
jerolba:GH-4006_remove_fastutil_dependency_from_parquet_hadoop

Conversation

@jerolba

@jerolba jerolba commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

parquet-hadoop declares and shades it.unimi.dsi:fastutil, but only uses it for a single IntArrayList in ColumnIndexFilterUtils, plus a LongArrayList in one test. That adds roughly 1 MB to the artifact for a single code path.

What changes are included in this PR?

  • Replace IntArrayList/IntList in ColumnIndexFilterUtils.filterOffsetIndex with a plain int[] sized by the page count and Arrays.copyOf.
  • Remove the it.unimi.dsi:fastutil dependency from parquet-hadoop/pom.xml.
  • Drop the fastutil notice from parquet-hadoop's META-INF/LICENSE, since the jar no longer bundles it.
  • Update TestParquetMetadataConverter to use Arrays.asList so tests do not need fastutil either.

The parquet-hadoop jar shrinks from 1,660,550 to 641,746 bytes and no longer contains shaded/parquet/it/unimi entries. The removed classes remain available at runtime from parquet-column, a compile-scope dependency that shades the same fastutil version under the same shaded.parquet prefix.

Are these changes tested?

Yes. TestParquetMetadataConverter#testColumnIndexConversion and TestColumnIndexFiltering pass; spotless:check and dependency:analyze-only pass. parquet-avro and parquet-hadoop-bundle still build and keep their own fastutil copies.

Are there any user-facing changes?

The parquet-hadoop jar is about 1 MB smaller and no longer duplicates fastutil classes that parquet-column already provides. There is no API or behavior change.

Closes #4006

### Rationale for this change

parquet-hadoop declares and shades it.unimi.dsi:fastutil, but only uses it for a single
IntArrayList in ColumnIndexFilterUtils, plus a LongArrayList in one test. That adds roughly 1 MB to
the artifact for a single code path.

### What changes are included in this PR?

- Replace IntArrayList/IntList in ColumnIndexFilterUtils.filterOffsetIndex with a plain int[] sized
  by the page count and Arrays.copyOf.
- Remove the it.unimi.dsi:fastutil dependency from parquet-hadoop/pom.xml.
- Drop the fastutil notice from parquet-hadoop's META-INF/LICENSE, since the jar no longer bundles
  it.
- Update TestParquetMetadataConverter to use Arrays.asList so tests do not need fastutil either.

The parquet-hadoop jar shrinks from 1,660,550 to 641,746 bytes and no longer contains
shaded/parquet/it/unimi entries. The removed classes remain available at runtime from
parquet-column, a compile-scope dependency that shades the same fastutil version under the same
shaded.parquet prefix.

### Are these changes tested?

Yes. TestParquetMetadataConverter#testColumnIndexConversion and TestColumnIndexFiltering pass;
spotless:check and dependency:analyze-only pass. parquet-avro and parquet-hadoop-bundle still build
and keep their own fastutil copies.

### Are there any user-facing changes?

The parquet-hadoop jar is about 1 MB smaller and no longer duplicates fastutil classes that
parquet-column already provides. There is no API or behavior change.

Closes apache#4006

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup @jerolba, thanks!

@Fokko
Fokko merged commit 819631c into apache:master Nov 30, 2026
5 checks passed
@jerolba

jerolba commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! In the same direction, #3781 helps to remove the hadoop-mapreduce-client-core transitive
dependency from parquet-hadoop, so together the two would help projects that use Parquet without
Hadoop. No dependency between them — just flagging it in case it's of interest.

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.

Remove the unused fastutil dependency from parquet-hadoop

2 participants