JingsongLi commented on code in PR #1109:
URL: https://github.com/apache/incubator-paimon/pull/1109#discussion_r1190749310
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/action/cdc/mysql/MySqlSyncTableAction.java:
##########
@@ -143,21 +167,41 @@ public void build(StreamExecutionEnvironment env) throws
Exception {
Identifier identifier = new Identifier(database, table);
FileStoreTable table;
- Schema fromMySql =
- MySqlActionUtils.buildPaimonSchema(
- mySqlSchema, partitionKeys, primaryKeys, tableConfig,
caseSensitive);
+ List<ComputedColumn> computedColumns = new ArrayList<>();
Review Comment:
```
List<ComputedColumn> computedColumns = MySqlActionUtils.buildComputedColumns(
computedColumnArgs, mySqlSchema.typeMapping());
Schema fromMySql =
MySqlActionUtils.buildPaimonSchema(
mySqlSchema,
partitionKeys,
primaryKeys,
computedColumns,
tableConfig,
caseSensitive);
try {
table = (FileStoreTable) catalog.getTable(identifier);
checkArgument(
computedColumns.isEmpty(),
"Cannot add computed column when table already exists.");
MySqlActionUtils.assertSchemaCompatible(table.schema(),
fromMySql);
} catch (Catalog.TableNotExistException e) {
catalog.createTable(identifier, fromMySql, false);
table = (FileStoreTable) catalog.getTable(identifier);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]