lsyldliu commented on code in PR #20442:
URL: https://github.com/apache/flink/pull/20442#discussion_r939502073
##########
flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/ParquetSplitReaderUtil.java:
##########
@@ -257,56 +271,136 @@ public static ColumnVector createVectorFromConstant(
}
}
+ private static List<ColumnDescriptor> getAllColumnDescriptorByType(
+ int depth, Type type, List<ColumnDescriptor> columns) throws
ParquetRuntimeException {
+ List<ColumnDescriptor> res = new ArrayList<>();
+ for (ColumnDescriptor descriptor : columns) {
+ if (depth >= descriptor.getPath().length) {
+ throw new InvalidSchemaException("Corrupted Parquet schema");
+ }
+ if (type.getName().equals(descriptor.getPath()[depth])) {
+ res.add(descriptor);
+ }
+ }
+ return res;
+ }
+
public static ColumnReader createColumnReader(
- boolean utcTimestamp,
+ boolean isUtcTimestamp,
LogicalType fieldType,
- ColumnDescriptor descriptor,
- PageReader pageReader)
+ Type type,
+ List<ColumnDescriptor> columnDescriptors,
+ PageReadStore pages,
+ int depth)
throws IOException {
+ List<ColumnDescriptor> descriptors =
+ getAllColumnDescriptorByType(depth, type, columnDescriptors);
Review Comment:
Regarding to arbitrary type, the `ColumnDescriptor` should exists, so I have
check the list in `getAllColumnDescriptorByType `.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]