From e2bb9ad7e792efca419fa7c4a1afde7c4c44fa01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Tudenh=C3=B6fner?= Date: Fri, 7 Oct 2022 18:59:41 +0200 Subject: [PATCH] Core: Increase inferred column metrics limit to 100 (#5933) Co-authored-by: Ryan Blue --- core/src/main/java/org/apache/iceberg/TableProperties.java | 2 +- .../test/java/org/apache/iceberg/io/TestWriterMetrics.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/apache/iceberg/TableProperties.java b/core/src/main/java/org/apache/iceberg/TableProperties.java index a8ca36379..4d833b0bf 100644 --- a/core/src/main/java/org/apache/iceberg/TableProperties.java +++ b/core/src/main/java/org/apache/iceberg/TableProperties.java @@ -259,7 +259,7 @@ private TableProperties() {} public static final String METRICS_MAX_INFERRED_COLUMN_DEFAULTS = "write.metadata.metrics.max-inferred-column-defaults"; - public static final int METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT = 32; + public static final int METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT = 100; public static final String METRICS_MODE_COLUMN_CONF_PREFIX = "write.metadata.metrics.column."; public static final String DEFAULT_WRITE_METRICS_MODE = "write.metadata.metrics.default"; diff --git a/data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java b/data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java index b559b976a..ab29fb74e 100644 --- a/data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java +++ b/data/src/test/java/org/apache/iceberg/io/TestWriterMetrics.java @@ -208,7 +208,7 @@ public void testMaxColumns() throws IOException { File tableDir = temp.newFolder(); tableDir.delete(); // created by table create - int numColumns = 33; + int numColumns = TableProperties.METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT + 1; List fields = Lists.newArrayListWithCapacity(numColumns); for (int i = 0; i < numColumns; i++) { fields.add(required(i, "col" + i, Types.IntegerType.get())); @@ -236,7 +236,7 @@ public void testMaxColumns() throws IOException { // start at 1 because IDs were reassigned in the table int id = 1; - for (; id <= 32; id += 1) { + for (; id <= TableProperties.METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT; id += 1) { Assert.assertNotNull("Should have lower bound metrics", dataFile.lowerBounds().get(id)); Assert.assertNotNull("Should have upper bound metrics", dataFile.upperBounds().get(id)); Assert.assertNull( @@ -262,7 +262,7 @@ public void testMaxColumnsWithDefaultOverride() throws IOException { File tableDir = temp.newFolder(); tableDir.delete(); // created by table create - int numColumns = 33; + int numColumns = TableProperties.METRICS_MAX_INFERRED_COLUMN_DEFAULTS_DEFAULT + 1; List fields = Lists.newArrayListWithCapacity(numColumns); for (int i = 0; i < numColumns; i++) { fields.add(required(i, "col" + i, Types.IntegerType.get()));