amogh-jahagirdar commented on code in PR #17960:
URL: https://github.com/apache/iceberg/pull/17960#discussion_r4134998375


##########
core/src/main/java/org/apache/iceberg/MetricsConfig.java:
##########
@@ -255,9 +260,36 @@ public Set<Integer> map(
    * @return metrics configuration
    */
   public static MetricsConfig from(Map<String, String> props, Schema schema, 
SortOrder order) {
-    int maxInferredDefaultColumns = maxInferredColumnDefaults(props);
     Map<Integer, String> idToName = Maps.newHashMap();
     Map<String, MetricsMode> columnModes = Maps.newHashMap();
+    MetricsMode defaultMode = defaultModeFor(props, schema, order, 
columnModes, idToName);
+    return new MetricsConfig(columnModes, defaultMode, idToName);
+  }
+
+  private static MetricsConfig from(
+      Map<String, String> props,
+      Schema schema,
+      SortOrder order,
+      PartitionSpec spec,
+      int formatVersion) {
+    Map<Integer, String> idToName = Maps.newHashMap();
+    Map<String, MetricsMode> columnModes = Maps.newHashMap();
+    MetricsMode defaultMode = defaultModeFor(props, schema, order, 
columnModes, idToName);
+
+    if (formatVersion >= 4) {
+      configureFullMetricsForPartitionSourceColumns(spec, schema, columnModes, 
idToName);

Review Comment:
   That's a great point, that approach makes the upgrde path be able to make 
better tightness assumptions. I went ahead and made that change. 



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

Reply via email to