Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vernedeng committed Oct 26, 2023
1 parent dd93941 commit 7955fa8
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class TubeMQDynamicTableFactory implements DynamicTableSourceFactory {

public static final String IDENTIFIER = "tubemq-inlong";

public static final List<String> INNERFORMATTYPE = Arrays.asList("inlong-msg");
public static final String INNERFORMATTYPE = "inlong-msg";

public static boolean innerFormat = false;

Expand All @@ -76,7 +76,7 @@ private static void validatePKConstraints(
&& format.getChangelogMode().containsOnly(RowKind.INSERT)) {
Configuration options = Configuration.fromMap(catalogTable.getOptions());
String formatName = options.getOptional(FORMAT).orElse(options.get(FORMAT));
innerFormat = INNERFORMATTYPE.contains(formatName);
innerFormat = INNERFORMATTYPE.equals(formatName);
throw new ValidationException(String.format(
"The TubeMQ table '%s' with '%s' format doesn't support defining PRIMARY KEY constraint"
+ " on the table, because it can't guarantee the semantic of primary key.",
Expand Down Expand Up @@ -109,7 +109,7 @@ public DynamicTableSource createDynamicTableSource(Context context) {
final DecodingFormat<DeserializationSchema<RowData>> valueDecodingFormat = getValueDecodingFormat(helper);

// validate all options
helper.validateExcept(INNERFORMATTYPE.toArray(new String[0]));
helper.validateExcept(INNERFORMATTYPE);

validatePKConstraints(context.getObjectIdentifier(), context.getCatalogTable(), valueDecodingFormat);

Expand Down

0 comments on commit 7955fa8

Please sign in to comment.