XuQianJin-Stars edited a comment on issue #1884:
URL: https://github.com/apache/iceberg/issues/1884#issuecomment-740310274
hi @zuoyebushiwo There are two ways to successfully create a hive table:
1. Specify the schema information and perform the following operations to
successfully create the table.
`
CREATE EXTERNAL TABLE customers STORED BY
'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' LOCATION
'hdfs://namenode:8020/cs/table_a' TBLPROPERTIES
('iceberg.mr.table.schema'='{"type":"struct","fields":[{"id":1,"name":"customer_id","required":false,"type":"long"},{"id":2,"name":"first_name","required":false,"type":"string"},{"id":3,"name":"last_name","required":false,"type":"string"}]}',
'iceberg.mr.table.partition.spec'='{"spec-id":0,"fields":[{"name":"customer_id","transform":"identity","source-id":1,"field-id":1000}]}',
'dummy'='test');
`
2.Create a hive external table on the hdfs path of the existing iceberg
table.
`
CREATE EXTERNAL TABLE customers2 STORED BY
'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' LOCATION
'hdfs://namenode:8020/cs/table_a';
`
----------------------------------------------------------------
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]