You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/10/30 11:52:38 UTC

[GitHub] [iceberg] luoyuxia commented on issue #6021: When I use flink sql to synchronize MySQL data to icerberg (hive catalog), an error is reported.

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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org