apache / apache/parquet-java

Provide callback to allow user defined key-value metadata merging strategy

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

Description

When merging footers, Parquet doesn't know how to merge conflicting user defined key-value metadata entries, and simply throws. It would be better to provide callbacks to let users define metadata merging strategies.

For example, in Spark SQL, we store our own schema information in Parquet files as key-value metadata (similar to parquet-avro). While trying to add schema merging support for reading Parquet files with different but compatible schemas, `InitContext.getMergedKeyValueMetaData` throws because we have different Spark SQL schemas stored in different Parquet data files. Thus, we have to overwrite `ParquetInputFormat` and merge the schema within `getSplits`, which is kinda hacky and inconvenient.

**Reporter**: [Cheng Lian](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=lian+cheng) / @liancheng
#### Related issues:
- [Release parquet-mr 1.6.0](https://github.com/apache/parquet-java/issues/1426) (is blocked by)

**Note**: *This issue was originally created as [PARQUET-194](https://issues.apache.org/jira/browse/PARQUET-194). 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 by reading InitContext.getMergedKeyValueMetaData and the existing ParquetInputFormat usage described in the issue. Trace how conflicting user-defined key-value metadata currently causes the merge to throw, then define and document a callback-based strategy that callers can provide. Done means compatible metadata can be merged without overriding ParquetInputFormat, while the default behavior remains covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.