akashmalbari commented on code in PR #18382:
URL: https://github.com/apache/iceberg/pull/18382#discussion_r4200076645
##########
core/src/test/java/org/apache/iceberg/TestMetricsConfig.java:
##########
@@ -289,6 +291,18 @@ void columnModeAndFieldIdsFromPartitionSpec() {
.isEqualTo(MetricsModes.Truncate.withLength(16));
}
+ @Test
+ void metricsFieldIdsCannotBeModified() {
+ MetricsConfig config = MetricsTestUtil.from(ImmutableMap.of(), SCHEMA);
+ Iterator<Integer> fieldIds = config.metricsFieldIds().iterator();
+
+ assertThat(fieldIds.next()).isEqualTo(ID);
+ assertThatThrownBy(fieldIds::remove)
+ .isInstanceOf(UnsupportedOperationException.class)
+ .hasMessage(null);
Review Comment:
Agreed. Removed the null-message assertion in f969905fe and kept only the
exception type check, using the narrow Checkstyle suppression for this test.
The full TestMetricsConfig class and core test Checkstyle pass.
--
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]