apache / apache/parquet-java

Delta Encoding is not used when dictionary enabled

Open
#2,024 7 comments 0 reactions 0 assignees View on GitHub
Component: Java Component: Parquet Priority: Major Type: bug
Dominant language
Java
Stars
3.1k
Forks
1.6k
Avg merge
3d 12h
Merged PRs (30d)
33

Description

Current code doesn't enable using both Delta Encoding and Dictionary Encoding. If I instantiate ParquetWriter like this :
```Java
val writer = new ParquetWriter[Group](outFile, new GroupWriteSupport, codec, blockSize, pageSize, dictPageSize, enableDictionary = true, true, ParquetProperties.WriterVersion.PARQUET_2_0, configuration)
```

Then this piece of code :
https://github.com/apache/parquet-mr/blob/master/parquet-column/src/main/java/org/apache/parquet/column/values/factory/DefaultValuesWriterFactory.java#L78-L86

Causes that DictionaryValuesWriter is used instead of the inferred DeltaLongEncodingWriter.

The original issue is here : https://github.com/apache/parquet-mr/pull/154#issuecomment-266489768

**Reporter**: [Jakub Liska](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=l154k)

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in parquet-column/src/main/java/org/apache/parquet/column/values/factory/DefaultValuesWriterFactory.java at lines 78-86, then trace how DictionaryValuesWriter is selected instead of the inferred DeltaLongEncodingWriter. Reproduce the ParquetWriter configuration from the issue and add coverage showing the expected encoding behavior when dictionary encoding is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.