jbonofre commented on code in PR #12897:
URL: https://github.com/apache/iceberg/pull/12897#discussion_r2060507585


##########
api/src/main/java/org/apache/iceberg/PartitionField.java:
##########
@@ -19,26 +19,49 @@
 package org.apache.iceberg;
 
 import java.io.Serializable;
+import java.util.List;
+import java.util.stream.Collectors;
 import org.apache.iceberg.relocated.com.google.common.base.Objects;
+import org.apache.iceberg.relocated.com.google.common.base.Preconditions;
 import org.apache.iceberg.transforms.Transform;
 
 /** Represents a single field in a {@link PartitionSpec}. */
 public class PartitionField implements Serializable {
-  private final int sourceId;
+  private final List<Integer> sourceIds;
   private final int fieldId;
   private final String name;
   private final Transform<?, ?> transform;
 
+  /**
+   * @deprecated since 1.10.0, will be removed in 2.0.0; use 
PartitionField(sourceIds, fieldId,
+   *     name, transform) instead.
+   */
+  @Deprecated
   PartitionField(int sourceId, int fieldId, String name, Transform<?, ?> 
transform) {
-    this.sourceId = sourceId;
+    this(List.of(sourceId), fieldId, name, transform);
+  }
+
+  PartitionField(List<Integer> sourceIds, int fieldId, String name, 
Transform<?, ?> transform) {
+    this.sourceIds = sourceIds;
     this.fieldId = fieldId;
     this.name = name;
     this.transform = transform;
   }
 
-  /** Returns the field id of the source field in the {@link PartitionSpec 
spec's} table schema. */
+  /**
+   * Returns the source field in the {@link PartitionSpec spec's} table schema.
+   *
+   * @deprecated since 1.10.0, will be removed in 2.0.0; use sourceIds() 
instead.
+   */
+  @Deprecated
   public int sourceId() {
-    return sourceId;
+    Preconditions.checkArgument(sourceIds.size() == 1, "Only one source is 
supported");

Review Comment:
   Better yeah. Let me update. Thanks for the proposal !



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

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


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

Reply via email to