Make DELTA_LENGTH_BYTE_ARRAY default encoding for binary values
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.6k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 33
Descripción
### Describe the enhancement requested
The current default for V1 pages is PLAIN encoding. This encoding mixes string length with string data. This is inefficient for for skipping N values, as the encoding does not allow random access. It's also slow to decode as the interleaving of lengths with data does not allow efficient batched implementations and forces most implementations to make copies of the data to fit the usual representation of separate offsets and data for strings.
DELTA_LENGTH_BYTE_ARRAY has none of the above problems as it separates offsets and data. The parquet-format spec also seems to recommend this
https://github.com/apache/parquet-format/blob/c70281359087dfaee8bd43bed9748675f4aabe11/Encodings.md?plain=1#L299
```
### Delta-length byte array: (DELTA_LENGTH_BYTE_ARRAY = 6)
Supported Types: BYTE_ARRAY
This encoding is always preferred over PLAIN for byte array columns.
```
V2 pages use DELTA_BYTE_ARRAY as the default encoding, this is an improvement over PLAIN but adds complexity which makes it slower to decode than DELTA_LENGTH_BYTE_ARRAY with the potential benefit of lower storage requirements.
JMH benchmarks in Trino's parquet reader at `io.trino.parquet.reader.BenchmarkBinaryColumnReader` showed that DELTA_LENGTH_BYTE_ARRAY can be decoded at over 5X speed and DELTA_BYTE_ARRAY at over 2X the speed of decoding PLAIN encoding.
Given the above recommendation of parquet-format spec and significant performance difference, the reference implementation here should be updated to use DELTA_LENGTH_BYTE_ARRAY by default.
### Component(s)
Core
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
El issue no nombra ningún archivo fuente ni ninguna prueba. Empieza localizando la selección de la codificación predeterminada de V1 y V2 en la implementación Core de parquet-java y, después, inspecciona las pruebas de codificación existentes. El trabajo está terminado cuando las columnas BYTE_ARRAY usan DELTA_LENGTH_BYTE_ARRAY de forma predeterminada, mientras que el resto del comportamiento de codificación permanece sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- data-engineering
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100