rdblue commented on a change in pull request #2952:
URL: https://github.com/apache/iceberg/pull/2952#discussion_r698057506
##########
File path: api/src/main/java/org/apache/iceberg/types/PruneColumns.java
##########
@@ -24,13 +24,24 @@
import org.apache.iceberg.Schema;
import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
import org.apache.iceberg.relocated.com.google.common.collect.Lists;
+import org.apache.iceberg.types.Types.ListType;
+import org.apache.iceberg.types.Types.MapType;
+import org.apache.iceberg.types.Types.StructType;
class PruneColumns extends TypeUtil.SchemaVisitor<Type> {
private final Set<Integer> selected;
+ private final boolean selectFullTypes;
- PruneColumns(Set<Integer> selected) {
+ /**
+ * Visits a schema and returns only the fields selected by the id set.
+ * @param selected ids of elements to return
+ * @param selectFullTypes when true, selecting a nested type selects all
subfields. When false selecting list or
+ * map types is undefined and forbidden.
Review comment:
Minor: I normally opt to explain behavior in the method description and
not in argument descriptions. Argument descriptions should state what the
argument controls, but not all the implications. Otherwise, the argument
descriptions are very long and reading the description doesn't cover the full
behavior of the method. I'd probably change this to just "when true, selecting
a nested type selects all subfields". And add a paragraph above that explains
the behavior for structs, maps, and lists.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]