sfc-gh-rspitzer commented on code in PR #12897:
URL: https://github.com/apache/iceberg/pull/12897#discussion_r2908538079
##########
api/src/main/java/org/apache/iceberg/PartitionField.java:
##########
@@ -19,26 +19,42 @@
package org.apache.iceberg;
import java.io.Serializable;
+import java.util.List;
import org.apache.iceberg.relocated.com.google.common.base.Objects;
+import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList;
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;
PartitionField(int sourceId, int fieldId, String name, Transform<?, ?>
transform) {
- this.sourceId = sourceId;
+ this(ImmutableList.of(sourceId), fieldId, name, transform);
+ }
+
+ PartitionField(List<Integer> sourceIds, int fieldId, String name,
Transform<?, ?> transform) {
+ this.sourceIds = ImmutableList.copyOf(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. */
public int sourceId() {
- return sourceId;
+ return sourceIds.get(0);
Review Comment:
I still think there should be a precondition that sourceIds length is = 1,
just to make sure folk are using this correctly
--
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]