apache / apache/parquet-java

Add an option to allow auto conversion from empty fields to NULL

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

Description

Right now, Parquet Writer throws out an exception:

`Parquet record is malformed: empty fields are illegal, the field should be ommited completely instead`

when an empty field (array or struct or map I guess?) is written.

The suggestion here is to add an option "auto_convert_empty_fields_to_null" that convert empty fields to null automatically on write.

The LOC to change is [here:](https://sourcegraph.com/github.com/apache/parquet-mr/-/blob/parquet-column/src/main/java/org/apache/parquet/io/MessageColumnIO.java#L328)
> `if (emptyField) {`
> ` {{   throw new ParquetEncodingException("empty fields are illegal, the field should be ommited completely instead");`}}
> ``}
 

**Reporter**: [Zheng Shao](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=zshao)

**Note**: *This issue was originally created as [PARQUET-1945](https://issues.apache.org/jira/browse/PARQUET-1945). 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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.