rdblue commented on code in PR #18331:
URL: https://github.com/apache/iceberg/pull/18331#discussion_r4148112124
##########
core/src/main/java/org/apache/iceberg/MetricsConfig.java:
##########
@@ -367,15 +367,15 @@ private static Map<String, MetricsMode>
partitionColumnModes(PartitionSpec spec)
private static Map<Integer, String> idToName(
Schema schema, Map<String, MetricsMode> columnModes) {
if (schema != null) {
- ImmutableMap.Builder<Integer, String> builder = ImmutableMap.builder();
- for (String name : columnModes.keySet()) {
- Types.NestedField field = schema.findField(name);
- if (field != null) {
- builder.put(field.fieldId(), name);
+ Map<Integer, String> idToName = Maps.newLinkedHashMap();
+ for (Integer fieldId : SchemaOrder.allFieldIds(schema)) {
Review Comment:
This uses `allFieldIds` to cover cases so that user-configured fields are
included even if they are not leaf fields.
--
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]