Parquet-Avro does not support field removal
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.6k
- Merge moyen
- 3 j 12 h
- PR mergées (30 j)
- 33
Description
Parquet avro does not support removal of fields, when used with the new compatibility layer:
Given a parquet file written with parquet avro at v1 and the following schema:
```Java
record FooBar {
long foo;
string bar;
}
```
And the following configuration settings:
```Java
job.getConfiguration.setBoolean(AvroReadSupport.AVRO_COMPATIBILITY, false)
AvroParquetInputFormat.setAvroReadSchema(job, avroReaderSchema)
```
A job fails when trying to read it using schema version v2:
```Java
record FooBar {
string bar;
}
```
With the error:
```Java
org.apache.parquet.io.InvalidRecordException: Parquet/Avro schema mismatch: Avro field 'foo' not found
at org.apache.parquet.avro.AvroRecordConverter.getAvroField(AvroRecordConverter.java:159)
```
It looks like because it sees the field in the original version it assumes the new version must expect it, but this case just means that the field was removed. Avro schema resolution dictates that you just ignore this field, since it is not relevant in the new version.
**Reporter**: [Thomas Omans](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=eggsby)
**Note**: *This issue was originally created as [PARQUET-465](https://issues.apache.org/jira/browse/PARQUET-465). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par AvroRecordConverter.java:159 et suivez la manière dont le schéma de lecture Avro configuré est comparé aux champs présents dans le fichier Parquet. Reproduisez la lecture de v1 vers v2 avec les paramètres de compatibilité de l'issue ; le travail est terminé lorsque le champ foo supprimé est ignoré tandis que bar est lu correctement sans InvalidRecordException.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- data-engineering
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100