apache / apache/parquet-java

Special case empty columns to store 0 pages and no column chunks in the footer

Offen
#1,731 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Component: Java Component: Parquet Priority: Major Type: enhancement
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.6k
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
33

Beschreibung

Currently when a column is empty, each row group will contain one page that encodes repetition and definition levels for this row group. These will be as many 0s as there are rows in the row group (stored in the row group metadata). These values are encoded using RLE so it ends up being very small.
However in cases where there are a lot of columns in a very sparse dataset we end up with a lot of empty column chunks (a column chunk is the data for a given column in a given row group). The metadata could become much smaller by omitting empty column chunks as the metadata of an empty column chunk can be derived from the row count in the corresponding row group.

I propose the following:
When a column chunk is empty, do not write any page to it.
Do not add the column chunk metadata in the footer for such empty columns.
A column chunk is empty if when writing the row group to disk, there is only one page and this page contains rl and dl that are only 0s. (completely empty column).
When reading the dataset:
- the column is present in the schema.
- if there's no column chunk in the footer for a given row group that means we can just replace rls and dls with infinite streams of 0s.
- any stats information can be replaced by #rows count of nulls in predicate push down.

This will help in cases where we have huge schemas where actually a small subset of columns are populated. The file data will now look like as if we had declared only the schema for columns that actually have data in them. Only the schema in the footer will mention those empty columns.

**Reporter**: [Julien Le Dem](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=julienledem) / @julienledem

**Note**: *This issue was originally created as [PARQUET-183](https://issues.apache.org/jira/browse/PARQUET-183). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, den im Issue beschriebenen Row-Group-Writer, die Verarbeitung der Column-Chunk-Metadaten im Footer und den Dataset-Reader nachzuverfolgen. Prüfe, wie Predicate Pushdown Statistiken nutzt und wie fehlende Column Chunks Repetition- und Definition-Levels bereitstellen könnten. Als abgeschlossen gilt die Arbeit, wenn leere Spalten keine Pages oder Column-Chunk-Metadaten im Footer schreiben und Reader die Levels mit dem Wert null sowie Null-Statistiken korrekt rekonstruieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
data-engineering
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.