Skip to content

Commit b80f6ae

Browse files
committed
try removing LATEST
1 parent 06e2a51 commit b80f6ae

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public InputStream getInitScriptResource(@Nonnull SchemaOptions schemaOptions) {
5959
final String schemaSuffix;
6060
switch (schemaOptions.schemaVersion()) {
6161
case null -> schemaSuffix = "schema-v1.sql";
62-
case SchemaOptions.LATEST -> schemaSuffix = "schema-v1.sql";
63-
case "1" -> schemaSuffix = "schema-v1.sql";
62+
case 1 -> schemaSuffix = "schema-v1.sql";
6463
default ->
6564
throw new IllegalArgumentException(
6665
"Unknown schema version " + schemaOptions.schemaVersion());

polaris-core/src/main/java/org/apache/polaris/core/persistence/bootstrap/SchemaOptions.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@
2525

2626
@PolarisImmutable
2727
public interface SchemaOptions {
28-
public static final String LATEST = "LATEST";
29-
3028
@Nullable
31-
String schemaVersion();
29+
Integer schemaVersion();
3230

3331
@Nullable
3432
String schemaFile();
@@ -38,13 +36,5 @@ default void validate() {
3836
if (schemaVersion() != null && schemaFile() != null) {
3937
throw new IllegalStateException("Only one of schemaVersion or schemaFile can be set.");
4038
}
41-
if (schemaVersion() != null && !schemaVersion().equals(LATEST)) {
42-
try {
43-
Integer.parseInt(schemaVersion());
44-
} catch (NumberFormatException e) {
45-
throw new IllegalArgumentException(
46-
"schemaVersion must be a valid integer or " + LATEST + ": " + schemaVersion(), e);
47-
}
48-
}
4939
}
5040
}

runtime/admin/src/main/java/org/apache/polaris/admintool/BootstrapCommand.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ static class SchemaInputOptions {
8383
@CommandLine.Option(
8484
names = {"-v", "--schema-version"},
8585
paramLabel = "<schema version>",
86-
description = "The version of the schema to load in [1, 2, LATEST].",
87-
defaultValue = SchemaOptions.LATEST)
88-
String schemaVersion;
86+
description = "The version of the schema to load in [1, 2, LATEST].")
87+
Integer schemaVersion;
8988

9089
@CommandLine.Option(
9190
names = {"--schema-file"},

0 commit comments

Comments
 (0)