RussellSpitzer commented on a change in pull request #2942:
URL: https://github.com/apache/iceberg/pull/2942#discussion_r715928818
##########
File path: core/src/main/java/org/apache/iceberg/MetricsConfig.java
##########
@@ -96,6 +98,28 @@ public static MetricsConfig forTable(Table table) {
return from(table.properties(), table.sortOrder());
}
+ /**
+ * Creates a metrics config for a position delete file.
+ *
+ * @param table an Iceberg table
+ */
+ public static MetricsConfig forPositionDelete(Table table) {
+ MetricsConfig config = new MetricsConfig();
+
+ config.columnModes.put(MetadataColumns.DELETE_FILE_PATH.name(),
MetricsModes.Full.get());
+ config.columnModes.put(MetadataColumns.DELETE_FILE_POS.name(),
MetricsModes.Full.get());
+
+ MetricsConfig tableConfig = forTable(table);
+
+ config.defaultMode = tableConfig.defaultMode;
+ tableConfig.columnModes.forEach((columnAlias, mode) -> {
+ String newColumnAlias =
DOT.join(MetadataColumns.DELETE_FILE_ROW_FIELD_NAME, columnAlias);
Review comment:
Maybe this is too much future planning, but since we'll need to look up
delete file column aliases via this same transformation in the future, maybe we
should codify it?
```java
public static String deleteMetricAlias(String columnName) {
return Dot.join(MetadataColumns.DELETE_FILE_ROW_FIELD_NAME, columnName)
}
```
--
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]