Skip to content

Commit 06e2a51

Browse files
committed
fix check
1 parent 6a929e2 commit 06e2a51

File tree

1 file changed

+8
-0
lines changed
  • polaris-core/src/main/java/org/apache/polaris/core/persistence/bootstrap

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,13 @@ default void validate() {
3838
if (schemaVersion() != null && schemaFile() != null) {
3939
throw new IllegalStateException("Only one of schemaVersion or schemaFile can be set.");
4040
}
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+
}
4149
}
4250
}

0 commit comments

Comments
 (0)