Skip to content

Commit

Permalink
Core: Increase inferred column metrics limit to 100 (#5933)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Blue <[email protected]>
  • Loading branch information
nastra and rdblue authored Oct 7, 2022
1 parent b177356 commit e2bb9ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/apache/iceberg/TableProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Types.NestedField> fields = Lists.newArrayListWithCapacity(numColumns);
for (int i = 0; i < numColumns; i++) {
fields.add(required(i, "col" + i, Types.IntegerType.get()));
Expand Down Expand Up @@ -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(
Expand All @@ -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<Types.NestedField> fields = Lists.newArrayListWithCapacity(numColumns);
for (int i = 0; i < numColumns; i++) {
fields.add(required(i, "col" + i, Types.IntegerType.get()));
Expand Down

0 comments on commit e2bb9ad

Please sign in to comment.