hailin0 commented on code in PR #6929: URL: https://github.com/apache/seatunnel/pull/6929#discussion_r1625234805
########## seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/base/schema/AbstractSchemaChangeResolver.java: ########## @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.seatunnel.connectors.cdc.base.schema; + +import org.apache.kafka.connect.data.Struct; +import org.apache.kafka.connect.source.SourceRecord; + +public abstract class AbstractSchemaChangeResolver implements SchemaChangeResolver { + + protected static final String DATABASENAME = "databaseName"; + + protected static final String SCHEMA_NAME = "schemaName"; + + protected static final String DDL = "ddl"; + + protected abstract String getDatabaseType(); + + @Override + public boolean support(SourceRecord record) { + String source = ((Struct) record.value()).getStruct("source").getString("connector"); + return source.equalsIgnoreCase(getDatabaseType()); Review Comment: It is necessary to judge the specific ddl statement to decide whether it is supported ########## seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/pom.xml: ########## @@ -98,6 +98,11 @@ <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> + <dependency> + <groupId>com.github.jsqlparser</groupId> + <artifactId>jsqlparser</artifactId> Review Comment: Why do we need jsqlparser? -- 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]
