JingsongLi commented on a change in pull request #17542: URL: https://github.com/apache/flink/pull/17542#discussion_r760713947
########## File path: flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/row/ParquetRowDataWriter.java ########## @@ -126,13 +134,29 @@ private FieldWriter createWriter(LogicalType t, Type type) { throw new UnsupportedOperationException("Unsupported type: " + type); } } else { - throw new IllegalArgumentException("Unsupported data type: " + t); + GroupType groupType = type.asGroupType(); + LogicalTypeAnnotation logicalType = type.getLogicalTypeAnnotation(); + + if (t instanceof ArrayType + && logicalType instanceof LogicalTypeAnnotation.ListLogicalTypeAnnotation) { + return new ArrayWriter(((ArrayType) t).getElementType(), groupType); + } else if (t instanceof MapType + && logicalType instanceof LogicalTypeAnnotation.MapLogicalTypeAnnotation) { + return new MapWriter( + ((MapType) t).getKeyType(), ((MapType) t).getValueType(), groupType); + } else if (t instanceof RowType && type instanceof GroupType) { + return new RowWriter(t, groupType); + } else { + throw new UnsupportedOperationException("Unsupported type: " + type); + } } } private interface FieldWriter { void write(RowData row, int ordinal); + + void write(Object value); Review comment: Can we add a method `write(ArrayData row, int ordinal)` here? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org