arina-ielchiieva commented on a change in pull request #1829: DRILL-7096:
Develop vector for canonical Map<K,V>
URL: https://github.com/apache/drill/pull/1829#discussion_r317075152
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/ParquetTableMetadataUtils.java
##########
@@ -573,19 +585,30 @@ public static OriginalType
getOriginalType(MetadataBase.ParquetTableMetadataBase
for (MetadataBase.ParquetFileMetadata file :
parquetTableMetadata.getFiles()) {
// row groups in the file have the same schema, so using the first one
Map<SchemaPath, TypeProtos.MajorType> fileColumns =
getFileFields(parquetTableMetadata, file);
- fileColumns.forEach((columnPath, type) -> {
- TypeProtos.MajorType majorType = columns.get(columnPath);
- if (majorType == null) {
- columns.put(columnPath, type);
- } else {
- TypeProtos.MinorType leastRestrictiveType =
TypeCastRules.getLeastRestrictiveType(Arrays.asList(majorType.getMinorType(),
type.getMinorType()));
- if (leastRestrictiveType != majorType.getMinorType()) {
- columns.put(columnPath, type);
- }
- }
- });
+ fileColumns.forEach((columnPath, type) -> putType(columns, columnPath,
type));
+ }
+ return columns;
+ }
+
+ static Map<SchemaPath, TypeProtos.MajorType>
resolveIntermediateFields(MetadataBase.ParquetTableMetadataBase
parquetTableMetadata) {
+ LinkedHashMap<SchemaPath, TypeProtos.MajorType> columns = new
LinkedHashMap<>();
Review comment:
Can we use `Map<SchemaPath, TypeProtos.MajorType> columns = ...`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services