zouyunhe created FLINK-20248:
--------------------------------
Summary: `ParquetSchemaConverter` can not convert Array type to parquet Type
Key: FLINK-20248
URL:
https://issues.apache.org/jira/browse/FLINK-20248 Project: Flink
Issue Type: Bug
Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
Affects Versions: 1.11.2
Reporter: zouyunhe
Run a simple code as below
{code:java}
Type arraySchema = ParquetSchemaConverter.toParquetType(Types.OBJECT_ARRAY(Types.INT), true);
System.out.println(arraySchema);{code}
which use `ParquetSchemaConverter` to convert array[Int] type to parquet Type, and the exception will throw
{code:java}
java.lang.ClassCastException: org.apache.parquet.schema.PrimitiveType cannot be cast to org.apache.parquet.schema.GroupTypejava.lang.ClassCastException: org.apache.parquet.schema.PrimitiveType cannot be cast to org.apache.parquet.schema.GroupType
at org.apache.flink.formats.parquet.utils.ParquetSchemaConverter.convertField(ParquetSchemaConverter.java:374) at org.apache.flink.formats.parquet.utils.ParquetSchemaConverter.toParquetType(ParquetSchemaConverter.java:74) at org.apache.flink.formats.parquet.utils.ParquetSchemaConverterTest.testArrayTypeConversion(ParquetSchemaConverterTest.java:113) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)