lyne7-sc opened a new issue, #1436:
URL: https://github.com/apache/paimon-rust/issues/1436

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/paimon-rust/issues) and found nothing 
similar.
   
   
   ### Please describe the bug 🐞
   
   DataFusion's Paimon `SQLContext` accepts a column-level `PRIMARY KEY` 
declaration but does not include it in the schema passed to the catalog.
   
   For example, these statements should declare the same primary key:
   
   ```sql
   CREATE TABLE mydb.inline_pk (id INT PRIMARY KEY, name VARCHAR);
   CREATE TABLE mydb.table_pk (id INT, name VARCHAR, PRIMARY KEY (id));
   ```
   
   The first statement produces an empty `Schema::primary_keys()`, while the 
second produces `["id"]`. The first table lacks the requested primary-key 
semantics.
   
   ### Solution
   
   Extract primary keys from both column definitions and table constraints, 
using the same identifier normalization as the columns. Reject multiple 
primary-key declarations while preserving support for a single composite 
primary key.
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to