You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/06/10 14:25:00 UTC

[GitHub] [iceberg] ConeyLiu commented on a diff in pull request #4999: Parquet: Fixes NPE when pruning columns

ConeyLiu commented on code in PR #4999:
URL: https://github.com/apache/iceberg/pull/4999#discussion_r894589685


##########
parquet/src/main/java/org/apache/iceberg/parquet/PruneColumns.java:
##########
@@ -164,8 +164,8 @@ private boolean isStruct(Type field) {
     } else {
       GroupType groupType = field.asGroupType();
       LogicalTypeAnnotation logicalTypeAnnotation = groupType.getLogicalTypeAnnotation();
-      return !logicalTypeAnnotation.equals(LogicalTypeAnnotation.mapType()) &&
-          !logicalTypeAnnotation.equals(LogicalTypeAnnotation.listType());
+      return !LogicalTypeAnnotation.mapType().equals(logicalTypeAnnotation) &&

Review Comment:
   I think it should be enough with `logicalTypeAnnotation == null` if the data is wroten by the given version parquet which is used in the current Iceberg code.



##########
parquet/src/main/java/org/apache/iceberg/parquet/PruneColumns.java:
##########
@@ -164,8 +164,8 @@ private boolean isStruct(Type field) {
     } else {
       GroupType groupType = field.asGroupType();
       LogicalTypeAnnotation logicalTypeAnnotation = groupType.getLogicalTypeAnnotation();
-      return !logicalTypeAnnotation.equals(LogicalTypeAnnotation.mapType()) &&
-          !logicalTypeAnnotation.equals(LogicalTypeAnnotation.listType());
+      return !LogicalTypeAnnotation.mapType().equals(logicalTypeAnnotation) &&

Review Comment:
   I think it should be enough with `logicalTypeAnnotation == null` if the data is wroten by the given version parquet which is used in the current Iceberg code.



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org