From 10b25365cc0512aa189f2877f05dae59d0cd45b1 Mon Sep 17 00:00:00 2001 From: Aitozi Date: Thu, 28 Mar 2024 14:11:41 +0800 Subject: [PATCH] fix --- .../paimon/schema/SchemaValidation.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java index d1a2024b5c546..3697f18e123b2 100644 --- a/paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java +++ b/paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java @@ -49,7 +49,6 @@ import static org.apache.paimon.CoreOptions.CHANGELOG_NUM_RETAINED_MAX; import static org.apache.paimon.CoreOptions.CHANGELOG_NUM_RETAINED_MIN; import static org.apache.paimon.CoreOptions.CHANGELOG_PRODUCER; -import static org.apache.paimon.CoreOptions.CHANGELOG_TIME_RETAINED; import static org.apache.paimon.CoreOptions.FIELDS_PREFIX; import static org.apache.paimon.CoreOptions.FULL_COMPACTION_DELTA_COMMITS; import static org.apache.paimon.CoreOptions.INCREMENTAL_BETWEEN; @@ -61,7 +60,6 @@ import static org.apache.paimon.CoreOptions.SCAN_TIMESTAMP_MILLIS; import static org.apache.paimon.CoreOptions.SNAPSHOT_NUM_RETAINED_MAX; import static org.apache.paimon.CoreOptions.SNAPSHOT_NUM_RETAINED_MIN; -import static org.apache.paimon.CoreOptions.SNAPSHOT_TIME_RETAINED; import static org.apache.paimon.CoreOptions.STREAMING_READ_OVERWRITE; import static org.apache.paimon.mergetree.compact.PartialUpdateMergeFunction.SEQUENCE_GROUP; import static org.apache.paimon.schema.SystemColumns.KEY_FIELD_PREFIX; @@ -124,21 +122,15 @@ public static void validateTableSchema(TableSchema schema) { SNAPSHOT_NUM_RETAINED_MIN.key() + " should not be larger than " + SNAPSHOT_NUM_RETAINED_MAX.key()); + checkArgument( - options.changelogTimeRetain().toMillis() >= options.snapshotTimeRetain().toMillis(), - CHANGELOG_TIME_RETAINED.key() - + " should not less than " - + SNAPSHOT_TIME_RETAINED.key()); + options.changelogNumRetainMin() > 0, + CHANGELOG_NUM_RETAINED_MIN.key() + " should be at least 1"); checkArgument( - options.changelogNumRetainMin() >= options.snapshotNumRetainMin(), + options.changelogNumRetainMin() <= options.changelogNumRetainMax(), CHANGELOG_NUM_RETAINED_MIN.key() - + " should not less than " - + SNAPSHOT_NUM_RETAINED_MIN.key()); - checkArgument( - options.changelogNumRetainMax() >= options.changelogNumRetainMax(), - CHANGELOG_NUM_RETAINED_MAX.key() - + " should not less than " - + SNAPSHOT_NUM_RETAINED_MAX.key()); + + " should not be larger than " + + CHANGELOG_NUM_RETAINED_MAX.key()); // Get the format type here which will try to convert string value to {@Code // FileFormatType}. If the string value is illegal, an exception will be thrown.