sfiend opened a new issue #2644:
URL: https://github.com/apache/iceberg/issues/2644


   I think this is a bug in [#2410](https://github.com/apache/iceberg/pull/2410)
   
   When I run alter properties with flink sql on a table with a specified 
primary key, i got an error:"Altering schema is not supported yet.". I checked 
the code logic in FlinkSchemaUtil, it called Flink 
TableSchema.Builder.primaryKey(String... columns) to build primary key, and 
this function will use UUID.randomUUID() to generate a primary key name.
       
   Druing the alter run , first will call FlinkCatalog.getTable, then will call 
FlinkCatalog.alterTable, FlinkSchemaUtil.toSchema will be called twice and 
return two TableSchema with different primary key name for the same table. So I 
will get the above error when checking the two TableSchema in alterTable 
function.
   
   Seems it's unnecessary to add primary key name into metadata of table, so 
should we specify the primary key name which derived by splicing with the 
prefix "PK_" and the hashcode of primary key's column names like Flink when 
build the primary key?  Glad to know your thought @openinx 


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to