diff --git a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/CdcDynamicTableParsingProcessFunction.java b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/CdcDynamicTableParsingProcessFunction.java index 777f82a952048..87aefeb586f55 100644 --- a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/CdcDynamicTableParsingProcessFunction.java +++ b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/CdcDynamicTableParsingProcessFunction.java @@ -107,7 +107,7 @@ public void processElement(T raw, Context context, Collector collector) th }); List schemaChange = parser.parseSchemaChange(); - if (schemaChange.size() > 0) { + if (!schemaChange.isEmpty()) { context.output( DYNAMIC_SCHEMA_CHANGE_OUTPUT_TAG, Tuple2.of(Identifier.create(database, tableName), schemaChange)); diff --git a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/RichEventParser.java b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/RichEventParser.java index f01d67d4aa97a..70a07724fa3f6 100644 --- a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/RichEventParser.java +++ b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/sink/cdc/RichEventParser.java @@ -20,6 +20,7 @@ import org.apache.paimon.types.DataField; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -35,7 +36,7 @@ public void setRawEvent(RichCdcRecord rawEvent) { @Override public List parseSchemaChange() { - return record.fields(); + return new ArrayList<>(record.fields()); } @Override