From 4b4becdcd7477ad709bd1f98ade5e494243daa29 Mon Sep 17 00:00:00 2001 From: chenzhuoyu Date: Tue, 6 Aug 2024 23:35:23 +0800 Subject: [PATCH] [flink] create table validate options --- .../org/apache/paimon/flink/FlinkCatalog.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java index c53ef3186f766..11bf054e96034 100644 --- a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java +++ b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalog.java @@ -18,8 +18,6 @@ package org.apache.paimon.flink; -import java.util.Arrays; -import java.util.HashSet; import org.apache.paimon.CoreOptions; import org.apache.paimon.catalog.Catalog; import org.apache.paimon.catalog.Identifier; @@ -95,8 +93,10 @@ import java.time.Duration; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -350,13 +350,17 @@ private void validateOptions(Map options) { }) .collect(Collectors.toSet()); - Set additionalValidOptions = new HashSet<>(Arrays.asList("is_streaming", "connector", "log.system")); + Set additionalValidOptions = + new HashSet<>(Arrays.asList("is_streaming", "connector", "log.system")); - options.keySet().forEach(optionKey -> { - if (!validOptions.contains(optionKey) && !additionalValidOptions.contains(optionKey)) { - throw new IllegalArgumentException("Invalid option: " + optionKey); - } - }); + options.keySet() + .forEach( + optionKey -> { + if (!validOptions.contains(optionKey) + && !additionalValidOptions.contains(optionKey)) { + throw new IllegalArgumentException("Invalid option: " + optionKey); + } + }); } protected Schema buildPaimonSchema(