Parquet 1.9 not forward compatible with Parquet 1.10
- Vorherrschende Sprache
- Java
- Sterne
- 3.1k
- Forks
- 1.6k
- Ø Merge
- 3 T. 12 Std.
- Gemergte PRs (30 T.)
- 33
Beschreibung
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.*
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginnen Sie in parquet-thrift/src/main/java/org/apache/parquet/thrift/struct/ThriftType.java und konzentrieren Sie sich auf StringType sowie den im stack trace gezeigten JSON-Parsing-Pfad. Reproduzieren Sie das Lesen eines Schemas, das das binary-Feld enthält, mit dem 1.9-Reader und vergleichen Sie es mit einem mit 1.10 generierten Schema. Erledigt ist die Aufgabe, wenn der ältere Reader das neuere Schema ohne UnrecognizedPropertyException akzeptiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- data
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 35/100