Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Make the order of encodings in column metadata deterministic

Aperta
#3,215 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java
Ambito
data

Direzione di ricerca

Inizia da org.apache.parquet.format.converter.ParquetMetadataConverter::toFormatEncodings e analizza come il HashSet di valori Encoding diventa l’elenco restituito. Il lavoro è completato quando la scrittura di dati equivalenti produce metadati Encoding in un ordine ordinale crescente deterministico, eliminando l’ordinamento dipendente dal processo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Java
Stelle
3.1k
Fork
1.6k
Merge medio
6g 16h
PR unite (30g)
36

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/parquet-java

Tutte le issue di apache/parquet-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.