apache / apache/parquet-java

Parquet 1.9 not forward compatible with Parquet 1.10

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

Description

This patch broke forward compatibility
https://issues.apache.org/jira/browse/PARQUET-357

This introduced a binary field which cannot be deserialized while reading from 1.9
New schema:
"type": { "id": "STRING", "binary": false }
Error message
```java

Caused by: java.lang.RuntimeException: shaded.parquet.org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "binary" (Class org.apache.parquet.thrift.struct.ThriftType$StringType), not marked as ignorable at [Source: java.io.StringReader@611b35d6; line: 23, column: 23] (through reference chain: org.apache.parquet.thrift.struct.StringType["binary"])
at org.apache.parquet.thrift.struct.JSON.fromJSON(JSON.java:38) at org.apache.parquet.thrift.struct.ThriftType.fromJSON(ThriftType.java:89) at org.apache.parquet.thrift.ThriftMetaData.parseDescriptor(ThriftMetaData.java:121)
... 19 more Caused by: shaded.parquet.org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "binary" (Class org.apache.parquet.thrift.struct.ThriftType$StringType), not marked as ignorable
```
A simple fix to 1.9 should fix this

 
```java

--- a/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java
+++ b/parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java
@@ -641,11 +641,23 @@ public abstract class ThriftType {
}
public static class StringType extends ThriftType {
+ private boolean binary = false;
+
+ @JsonIgnore
+ public boolean isBinary() {
+ return binary;
+ }
+
+ @JsonProperty
+ public void setBinary(boolean binary) {
+ this.binary = binary;
+ }
```

**Reporter**: [Nikhil Goyal](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=nownikhil)

**Note**: *This issue was originally created as [PARQUET-2002](https://issues.apache.org/jira/browse/PARQUET-2002). 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-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java, focusing on StringType and the JSON parsing path shown in the stack trace. Reproduce reading a schema containing the binary field with the 1.9 reader and compare it with a 1.10-generated schema. Done means the older reader accepts the newer schema without the UnrecognizedPropertyException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.