apache / apache/parquet-java

parquet-cli fails at supporting parquet-protobuf generated files

Abierto
#2,708 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Component: CLI Component: Parquet Priority: Critical Type: bug
Lenguaje dominante
Java
Estrellas
3.1k
Forks
1.6k
Merge medio
3 d 12 h
PR fusionados (30 d)
33

Descripción

i generated a parquet file using a protobuf with this proto definition:

```java

message IndexPath {
  // Index of item in path.
  repeated int32 index = 1;
}

message SomeEvent {
  // truncated/obfuscated wrapper
optional IndexPath client_position = 1;
}
```

this gets translated to the following parquet schema using the new compliant schema for lists:

```java

message SomeEvent {
  optional group client_position = 1 {
    optional group index (LIST) = 1 {
      repeated group list {
        required int32 element;
      }
    }
  }
}
```

this causes parquet-cli cat to barf on a file containing these events:
> java.lang.RuntimeException: Failed on record 0
> at org.apache.parquet.cli.commands.CatCommand.run(CatCommand.java:86)
> at org.apache.parquet.cli.Main.run(Main.java:157)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)
> at org.apache.parquet.cli.Main.main(Main.java:187)
> Caused by: java.lang.ClassCastException: required int32 element is not a group
> at org.apache.parquet.schema.Type.asGroupType(Type.java:248)
> at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:284)
> at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:228)
> at org.apache.parquet.avro.AvroRecordConverter.access$100(AvroRecordConverter.java:74)
> at org.apache.parquet.avro.AvroRecordConverter$AvroCollectionConverter$ElementConverter.(AvroRecordConverter.java:539)
> at org.apache.parquet.avro.AvroRecordConverter$AvroCollectionConverter.(AvroRecordConverter.java:489)
> at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:293)
> at org.apache.parquet.avro.AvroRecordConverter.(AvroRecordConverter.java:137)
> at org.apache.parquet.avro.AvroRecordConverter.newConverter(AvroRecordConverter.java:284)
> at org.apache.parquet.avro.AvroRecordConverter.(AvroRecordConverter.java:137)
> at org.apache.parquet.avro.AvroRecordConverter.(AvroRecordConverter.java:91)
> at org.apache.parquet.avro.AvroRecordMaterializer.(AvroRecordMaterializer.java:33)
> at org.apache.parquet.avro.AvroReadSupport.prepareForRead(AvroReadSupport.java:142)
> at org.apache.parquet.hadoop.InternalParquetRecordReader.initialize(InternalParquetRecordReader.java:190)
> at org.apache.parquet.hadoop.ParquetReader.initReader(ParquetReader.java:166)
> at org.apache.parquet.hadoop.ParquetReader.read(ParquetReader.java:135)
> at org.apache.parquet.cli.BaseCommand$1$1.advance(BaseCommand.java:363)
> at org.apache.parquet.cli.BaseCommand$1$1.(BaseCommand.java:344)
> at org.apache.parquet.cli.BaseCommand$1.iterator(BaseCommand.java:342)
> at org.apache.parquet.cli.commands.CatCommand.run(CatCommand.java:73)
> ... 3 more
using the old parquet-tools binary to cat this file works fine.

**Reporter**: [J Y](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jinyius) / @jinyius
#### Original Issue Attachments:
- [sample-depth-1.tgz](https://issues.apache.org/jira/secure/attachment/13048925/sample-depth-1.tgz)
- [samples.tgz](https://issues.apache.org/jira/secure/attachment/13048789/samples.tgz)

**Note**: *This issue was originally created as [PARQUET-2181](https://issues.apache.org/jira/browse/PARQUET-2181). 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

Start with parquet-cli's CatCommand.run and the AvroRecordConverter locations shown in the stack trace, then reproduce the failure with the attached sample files using parquet-cli cat. Compare the generated nested LIST schema with the converter's expected element type. Done means the supplied parquet-protobuf files can be read without the reported ClassCastException.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
cli, databases
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.