CodyPin commented on issue #3308:
URL: https://github.com/apache/paimon/issues/3308#issuecomment-2102317357

   On futher investigation, using the query 
   `show KEYS from <tablename> where Key_name = 'PRIMARY';` 
   on the tables that got included, namely `user` and `sku_list` shows this
   
![firefox_aDVDCyceji](https://github.com/apache/paimon/assets/80540276/c6fc0926-8d26-4b6e-9a64-b43d5e17a789)
   
![firefox_tzV4e1xere](https://github.com/apache/paimon/assets/80540276/ae05bf72-1d11-4ca3-95f3-0fe0789a32e3)
   
   
   But on those who got filtered out, for example `store` and `payment_record`, 
it reutrns nothing:
   
![firefox_oPP2Vc5Xn7](https://github.com/apache/paimon/assets/80540276/f67b0a1a-aed3-4f54-bf2f-74c7af19565c)
   
![firefox_ff3m4hgh1S](https://github.com/apache/paimon/assets/80540276/66ebfc1f-7e90-46b6-846a-f8aeebe0464e)
   
   Even tho when we query `describe store` shows that the table does indeed 
have a primary key:
   
![firefox_bLKW9TK5n0](https://github.com/apache/paimon/assets/80540276/596a05f0-8c30-4b66-9c63-57d45f939f40)
   
   Turns out, when the tables were created, it didn't specify the primary key, 
but was instead later added using the query 
   `ALTER TABLE store ADD PRIMARY KEY (id); `. This leads to the problem that 
it might appears that the table does not have a primary key, like when using 
the query `show create table store;` will show this:
   
![firefox_SpXNHLZxDb](https://github.com/apache/paimon/assets/80540276/7305d38e-ab42-4284-9773-72e1f9f2bbba)
   showing that it does not have a primary key.
   
   With that said, althought the tables clearly have a primary key, it might 
appares as it does not depending on how we are checking for its existence, and 
of course [Paimon only synchronizes tables with primary 
keys](https://paimon.apache.org/docs/master/flink/cdc-ingestion/mysql-cdc/#synchronizing-databases).
 So I think this is a bug in the wording of the documents, but would be a 
really nice feature if it would include tables that have a primary no matter if 
its created with or altered later on.
   @MOBIN-F what do you think?


-- 
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]

Reply via email to