pvary opened a new pull request #1495:
URL: https://github.com/apache/iceberg/pull/1495


   This patch enables the following commands from Hive:
   
   - Table creation (with HadoopTables LOCATION should be provided too):
   ```sql
   CREATE EXTERNAL TABLE customers 
   STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' 
   TBLPROPERTIES 
('iceberg.mr.table.schema'='{"type":"struct","fields":[{"id":1,"name":"customer_id","required":true,"type":"long"},{"id":2,"name":"first_name","required":true,"type":"string"}]}');
   ```
   or
   ```sql
   CREATE EXTERNAL TABLE customers 
   STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler'
   LOCATION 's3://some_bucket/some_path/table_a'
   TBLPROPERTIES 
('iceberg.mr.table.schema'='{"type":"struct","fields":[{"id":1,"name":"customer_id","required":true,"type":"long"},{"id":2,"name":"first_name","required":true,"type":"string"}]}');
   ```
   - Table drop:
   ```sql
   DROP TABLE customers;
   ```
   
   The backing Iceberg table is created/dropped automatically using the 
Catalogs new interface methods created by (#1481).
   With the help of #1407 this patch will enable CREATE/INSERT/DROP path using 
Hive queries and backed by Iceberg tables.
   
   The patch consists of the following main changes:
   - The first commit is just the squashed commits of #1481 since they are 
needed here
   - HiveTableOperations / BaseMetastoreCatalog changes to allow initializing 
already created HMS tables by adding the appropriate Iceberg related data - The 
exception handling might merit a second look here, opted for the less 
disrupting change for now
   - Catalogs.canWorkWithoutHive method - not too proud about it but needed to 
throw an exception if the user wants to keep the backing Iceberg table but 
trying to drop the Hive table without purging. Any better ideas would be 
welcome 😄 
   - Implementation of the HiveIcebergMetaHook which does the actual job
   - Small change in the HiveIcebergSerDe to handle Schema definition even if 
the table is not yet created
   - Tests for positive and negative cases
   


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