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/11/09 18:43:54 UTC

[GitHub] [iceberg] aokolnychyi commented on a diff in pull request #6163: Core: Method for building common partition type

aokolnychyi commented on code in PR #6163:
URL: https://github.com/apache/iceberg/pull/6163#discussion_r1018295880


##########
core/src/main/java/org/apache/iceberg/Partitioning.java:
##########
@@ -195,41 +198,68 @@ public Void alwaysNull(int fieldId, String sourceName, int sourceId) {
   }
 
   /**
-   * Builds a common partition type for all specs in a table.
+   * Builds an intersection of all partition types in a table.
    *
-   * <p>Whenever a table has multiple specs, the partition type is a struct containing all columns
-   * that have ever been a part of any spec in the table.
+   * <p>Whenever a table has multiple specs, the common partition type is a struct containing only
+   * fields that are present in every spec of the table. In other words, the struct fields represent
+   * an intersection of all partition types.
    *
-   * @param table a table with one or many specs
+   * @param specs one or many specs
    * @return the constructed common partition type
    */
+  public static StructType commonPartitionType(Collection<PartitionSpec> specs) {

Review Comment:
   I need to think of a better name here. Ideas are welcome.



-- 
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