You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "zhangjun0x01 (via GitHub)" <gi...@apache.org> on 2023/07/20 02:02:14 UTC

[GitHub] [incubator-paimon] zhangjun0x01 opened a new issue, #1605: [Bug] flink can not sync new mysql table with primary key

zhangjun0x01 opened a new issue, #1605:
URL: https://github.com/apache/incubator-paimon/issues/1605

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/incubator-paimon/issues) and found nothing similar.
   
   
   ### Paimon version
   
   master 
   
   ### Compute Engine
   
   flink
   
   ### Minimal reproduce step
   
   1. start a flink sync job to sync mysql database to paimon
   2. create a mysql table with primary key, like this `create table t1(id int primary key, name varchar(10))`
   3. can not sync the mysql table to paimon.
   
   ### What doesn't meet your expectations?
   
   can not sync the mysql table to paimon. 
   
   
    
   
   ### Anything else?
   
   reason:
   
   `com.alibaba.druid.sql.SQLUtils` can not parse the create table ddl correctly, 
   for example , we have the following test case:
   
   ```
          String ddl = "create table t1(id int primary key, name varchar(10))";
           SQLStatement statement = SQLUtils.parseSingleStatement(ddl, JdbcConstants.MYSQL);
           MySqlCreateTableStatement createTableStatement = (MySqlCreateTableStatement) statement;
           List<String> primaryKeys = createTableStatement.getPrimaryKeyNames();
           System.out.println(primaryKeys);
   ```
   
   the `primaryKeys` will be empty.
   
   if the ddl is like this , `CREATE TABLE t2 (k INT, v1 VARCHAR(10), PRIMARY KEY (k))` ,it  can be parsed correctly.
   
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@paimon.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-paimon] zhangjun0x01 closed issue #1605: [Bug] flink can not sync new mysql table with primary key

Posted by "zhangjun0x01 (via GitHub)" <gi...@apache.org>.
zhangjun0x01 closed issue #1605: [Bug] flink can not sync new mysql table with primary key
URL: https://github.com/apache/incubator-paimon/issues/1605


-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org