diff --git a/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfiguration.java b/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfiguration.java index b2dc914f4..7b9496802 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfiguration.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/PolarisConfiguration.java @@ -276,7 +276,9 @@ public static Builder builder() { public static final PolarisConfiguration STORAGE_CONFIGURATION_MAX_LOCATIONS = PolarisConfiguration.builder() .key("STORAGE_CONFIGURATION_MAX_LOCATIONS") - .description("How many locations can be associated with a storage configuration") + .catalogConfig("max.locations") + .description("How many locations can be associated with a storage configuration, or -1 for" + + " unlimited locations") .defaultValue(20) .build(); } diff --git a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java index 6b0638e83..add6b2d1f 100644 --- a/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java +++ b/polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisStorageConfigurationInfo.java @@ -232,7 +232,7 @@ protected void validatePrefixForStorageType(String loc) { /** Validate the number of allowed locations not exceeding the max value. */ public void validateMaxAllowedLocations(int maxAllowedLocations) { - if (allowedLocations.size() > maxAllowedLocations) { + if (maxAllowedLocations != -1 && allowedLocations.size() > maxAllowedLocations) { throw new IllegalArgumentException( "Number of allowed locations exceeds " + maxAllowedLocations); }