luoyuxia commented on issue #6021:
URL: https://github.com/apache/iceberg/issues/6021#issuecomment-1296233911

   Seems the primiary key can't be derived from the iceberg's HiveCatalog even 
though you have defined it using Hive Cli . 
   
   1. you can define with the following using Flink SQL
   ```
   CREATE TABLE ods_data_1_1 (
       xxx,
       xxx,
       PRIMARY KEY(`id`) NOT ENFORCED
   ) WITH (
       'connector'='iceberg',
       'catalog-name'='hive_prod',
       'catalog-database'='default',
       'catalog-table'='ods_data_1_1',
       'uri'='hdfs://nn-1:8020/user/hive/warehouse/',
       'warehouse'='hdfs://nn:8020/path/to/warehouse'
   );
   ```
   Note: it won't create a table, it's just a mapping to the table crated 
before in Hive 
   Then write the data using the sql normally.
   
   2. You can use Flink DDL to create the table, the Hive should have the 
ability to read the table.  Have you ever followed the document [enable Iceberg 
support] 
(https://iceberg.apache.org/docs/latest/hive/#enabling-iceberg-support-in-hive)?


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


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

Reply via email to