rdblue commented on code in PR #15514:
URL: https://github.com/apache/iceberg/pull/15514#discussion_r2925564407
##########
api/src/main/java/org/apache/iceberg/types/TypeUtil.java:
##########
@@ -102,6 +103,19 @@ public static Schema select(Schema schema, Set<Integer>
fieldIds) {
return new Schema(ImmutableList.of(), schema.getAliases());
}
+ /**
+ * Selects fields from a schema by ID and returns them ordered by field ID.
+ *
+ * <p>Unlike {@link #select(Schema, Set)}, which preserves the field
ordering of the input schema,
+ * this method always returns columns sorted by field ID.
+ */
+ public static Schema selectOrdered(Schema schema, Set<Integer> fieldIds) {
Review Comment:
I think the requirement here is that it is ordered consistently, not that it
is a particular order.
--
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]