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 2021/04/18 00:54:01 UTC

[GitHub] [iceberg] rdblue commented on a change in pull request #2454: Fix describing v1 table with void transform partitions.

rdblue commented on a change in pull request #2454:
URL: https://github.com/apache/iceberg/pull/2454#discussion_r615322994



##########
File path: api/src/main/java/org/apache/iceberg/transforms/PartitionSpecVisitor.java
##########
@@ -114,13 +115,10 @@ default T unknown(int fieldId, String sourceName, int sourceId, String transform
    */
   @Deprecated
   static <R> List<R> visit(Schema schema, PartitionSpec spec, PartitionSpecVisitor<R> visitor) {
-    List<R> results = Lists.newArrayListWithExpectedSize(spec.fields().size());
-
-    for (PartitionField field : spec.fields()) {
-      results.add(visit(schema, field, visitor));
-    }
-
-    return results;
+    return spec.fields().stream()
+        .map(field -> visit(schema, field, visitor))
+        .filter(Objects::nonNull)

Review comment:
       I don't think it is right to automatically discard nulls. Those might be part of the result produced by the visitor. And it is not possible to see which field produced the null value.




-- 
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:
users@infra.apache.org



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