You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/08/10 04:08:19 UTC

[GitHub] [iceberg] aokolnychyi commented on a diff in pull request #5376: Core: Add readable metrics columns to files metadata tables

aokolnychyi commented on code in PR #5376:
URL: https://github.com/apache/iceberg/pull/5376#discussion_r941997542


##########
core/src/main/java/org/apache/iceberg/MetricsUtil.java:
##########
@@ -56,4 +63,125 @@ public static MetricsModes.MetricsMode metricsMode(
     String columnName = inputSchema.findColumnName(fieldId);
     return metricsConfig.columnMode(columnName);
   }
+
+  // Utilities for Displaying Metrics
+
+  static final Types.NestedField COLUMN_SIZES_METRICS =
+      optional(
+          300,
+          "column_sizes_metrics",
+          Types.MapType.ofRequired(301, 302, Types.StringType.get(), Types.LongType.get()),
+          "Map of column name to total size on disk");
+  static final Types.NestedField VALUE_COUNT_METRICS =
+      optional(
+          303,
+          "value_counts_metrics",
+          Types.MapType.ofRequired(304, 305, Types.StringType.get(), Types.LongType.get()),
+          "Map of column name to total count, including null and NaN");
+  static final Types.NestedField NULL_VALUE_COUNTS_METRICS =
+      optional(
+          306,
+          "null_value_counts_metrics",
+          Types.MapType.ofRequired(307, 308, Types.StringType.get(), Types.LongType.get()),
+          "Map of column name to null value count");
+  static final Types.NestedField NAN_VALUE_COUNTS_METRICS =
+      optional(
+          309,
+          "nan_value_counts_metrics",
+          Types.MapType.ofRequired(310, 311, Types.StringType.get(), Types.LongType.get()),
+          "Map of column name to number of NaN values in the column");
+  static final Types.NestedField LOWER_BOUNDS_METRICS =
+      optional(
+          312,
+          "lower_bounds_metrics",
+          Types.MapType.ofRequired(313, 314, Types.StringType.get(), Types.StringType.get()),
+          "Map of column name to lower bound in string format");
+  static final Types.NestedField UPPER_BOUNDS_METRICS =
+      optional(
+          315,
+          "upper_bounds_metrics",
+          Types.MapType.ofRequired(316, 317, Types.StringType.get(), Types.StringType.get()),
+          "Map of column name to upper bound in string format");
+  public static final Schema METRICS_DISPLAY_SCHEMA =

Review Comment:
   Can we make it package-private in the table and have tests in the corresponding module?



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

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


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