Enums are incorrectly handled by parquet-avro when using GenericRecords
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.6k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 33
Descripción
It appears that enums are handled incorrectly when reading parquet as generic records.
Looking at the code:
https://github.com/apache/parquet-mr/blob/master/parquet-avro/src/main/java/org/apache/parquet/avro/AvroIndexedRecordConverter.java#L236-L238
FieldEnumConverter falls back to a string representation when it can't find the corresponding enum class. This is problematic when trying to read parquet files generically without specific records on the classpath because the records will no longer match the schema. I believe a more correct approach would be to wrap the enums in GenericData.EnumSymbol:
https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/generic/GenericData.java#L397
**Reporter**: [Igor Bernstein](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=igorbernstein)
**Note**: *This issue was originally created as [PARQUET-557](https://issues.apache.org/jira/browse/PARQUET-557). 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 parquet-avro/src/main/java/org/apache/parquet/avro/AvroIndexedRecordConverter.java, en el código de FieldEnumConverter alrededor de las líneas 236-238, y luego compara el comportamiento referenciado de GenericData.EnumSymbol en GenericData.java de Avro. Verifica que las lecturas de registros genéricos conserven la representación del esquema enum en lugar de recurrir a un string; el issue estará terminado cuando los registros resultantes coincidan con el esquema.
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
- Bien especificado
- Aptitud para principiantes
- 45/100