Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Make the order of encodings in column metadata deterministic

Open
#3,215 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
java
Domain
data

Research direction

Start at org.apache.parquet.format.converter.ParquetMetadataConverter::toFormatEncodings and inspect how the HashSet of Encoding values becomes the returned list. The work is done when equivalent written data produces encoding metadata in a deterministic ascending ordinal order, eliminating process-dependent ordering.

Written by the indexing model from the issue text.

Description

Type: enhancement
Describe the enhancement requested

Background
The list of encodings used for a column is stored in the column metadata in the Parquet file footer.

The elements in this list are enumeration constants (org.apache.parquet.format.Encoding), which are collected in a HashSet when the records and fields are written. Later, when the footer is written, the set of enum constants are converted to a temporary list using the HashSet’s iteration order.

Since Enum::hashCode delegates to Object::hashCode (or, in later JDK versions, to System::identityHashCode), the order of the enum constants in this list can vary between runs in different processes, and thus files with identical encodings can represent this list differently (the elements may appear in different order).

Rationale for changing this behaviour
Two processes running the same version of parquet-java and having identical writer configurations can still produce files that are different at the binary level for the exact same written data.

For redundancy reasons, it is not uncommon to write data to Parquet files on two different machines. To verify that the same data has been written on both machines, it is currently not sufficient to compare the files ate the binary level. Instead, the files must be decoded and their actual data must be compared to ensure they are equal.

If the files can be made identical at the binary level, this verification process would be simplified.

Suggested change
The list of encodings is created in org.apache.parquet.format.converter.ParquetMetadataConverter::toFormatEncodings. A simple solution is to sort this list before it is returned, i.e. always return the Encoding enum constants in ascending ordinal order.

Component(s)

Core

Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
6d 16h
Merged PRs (30d)
36

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/parquet-java

All issues in apache/parquet-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.