Parquet-Avro does not support field removal
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.6k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 33
Descripción
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.*
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en AvroRecordConverter.java:159 y sigue cómo se compara el esquema de lectura de Avro configurado con los campos presentes en el archivo Parquet. Reproduce la lectura de v1 a v2 con la configuración de compatibilidad del issue; se considera terminado cuando se ignora el campo foo eliminado mientras bar se lee correctamente sin InvalidRecordException.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- data-engineering
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100