in paimon-core/src/main/java/org/apache/paimon/schema/SchemaValidation.java [266:356]
private static void validateStartupMode(CoreOptions options) {
if (options.startupMode() == CoreOptions.StartupMode.FROM_TIMESTAMP) {
checkExactOneOptionExistInMode(
options, options.startupMode(), SCAN_TIMESTAMP_MILLIS, SCAN_TIMESTAMP);
checkOptionsConflict(
options,
Arrays.asList(
SCAN_SNAPSHOT_ID,
SCAN_FILE_CREATION_TIME_MILLIS,
SCAN_TAG_NAME,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_BETWEEN,
INCREMENTAL_TO_AUTO_TAG),
Arrays.asList(SCAN_TIMESTAMP_MILLIS, SCAN_TIMESTAMP));
} else if (options.startupMode() == CoreOptions.StartupMode.FROM_SNAPSHOT) {
checkExactOneOptionExistInMode(
options,
options.startupMode(),
SCAN_SNAPSHOT_ID,
SCAN_TAG_NAME,
SCAN_WATERMARK);
checkOptionsConflict(
options,
Arrays.asList(
SCAN_TIMESTAMP_MILLIS,
SCAN_TIMESTAMP,
SCAN_FILE_CREATION_TIME_MILLIS,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_BETWEEN,
INCREMENTAL_TO_AUTO_TAG),
Arrays.asList(SCAN_SNAPSHOT_ID, SCAN_TAG_NAME));
} else if (options.startupMode() == CoreOptions.StartupMode.INCREMENTAL) {
checkExactOneOptionExistInMode(
options,
options.startupMode(),
INCREMENTAL_BETWEEN,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_TO_AUTO_TAG);
checkOptionsConflict(
options,
Arrays.asList(
SCAN_SNAPSHOT_ID,
SCAN_TIMESTAMP_MILLIS,
SCAN_FILE_CREATION_TIME_MILLIS,
SCAN_TIMESTAMP,
SCAN_TAG_NAME),
Arrays.asList(
INCREMENTAL_BETWEEN,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_TO_AUTO_TAG));
} else if (options.startupMode() == CoreOptions.StartupMode.FROM_SNAPSHOT_FULL) {
checkOptionExistInMode(options, SCAN_SNAPSHOT_ID, options.startupMode());
checkOptionsConflict(
options,
Arrays.asList(
SCAN_TIMESTAMP_MILLIS,
SCAN_TIMESTAMP,
SCAN_FILE_CREATION_TIME_MILLIS,
SCAN_TAG_NAME,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_BETWEEN,
INCREMENTAL_TO_AUTO_TAG),
Collections.singletonList(SCAN_SNAPSHOT_ID));
} else if (options.startupMode() == CoreOptions.StartupMode.FROM_FILE_CREATION_TIME) {
checkOptionExistInMode(
options,
SCAN_FILE_CREATION_TIME_MILLIS,
CoreOptions.StartupMode.FROM_FILE_CREATION_TIME);
checkOptionsConflict(
options,
Arrays.asList(
SCAN_SNAPSHOT_ID,
SCAN_TIMESTAMP_MILLIS,
SCAN_TAG_NAME,
INCREMENTAL_BETWEEN_TIMESTAMP,
INCREMENTAL_BETWEEN,
INCREMENTAL_TO_AUTO_TAG),
Collections.singletonList(SCAN_FILE_CREATION_TIME_MILLIS));
} else {
checkOptionNotExistInMode(options, SCAN_TIMESTAMP_MILLIS, options.startupMode());
checkOptionNotExistInMode(
options, SCAN_FILE_CREATION_TIME_MILLIS, options.startupMode());
checkOptionNotExistInMode(options, SCAN_TIMESTAMP, options.startupMode());
checkOptionNotExistInMode(options, SCAN_SNAPSHOT_ID, options.startupMode());
checkOptionNotExistInMode(options, SCAN_TAG_NAME, options.startupMode());
checkOptionNotExistInMode(
options, INCREMENTAL_BETWEEN_TIMESTAMP, options.startupMode());
checkOptionNotExistInMode(options, INCREMENTAL_BETWEEN, options.startupMode());
checkOptionNotExistInMode(options, INCREMENTAL_TO_AUTO_TAG, options.startupMode());
}
}