| ==== |
| ---- QUERY |
| CREATE TABLE iceberg_hadoop_tables( |
| level STRING |
| ) |
| STORED AS ICEBERG |
| TBLPROPERTIES('iceberg.catalog'='hadoop.tables'); |
| ALTER TABLE iceberg_hadoop_tables ADD COLUMNS(event_time TIMESTAMP, register_time DATE); |
| ALTER TABLE iceberg_hadoop_tables ADD COLUMNS(message STRING, price DECIMAL(8,1)); |
| ALTER TABLE iceberg_hadoop_tables ADD COLUMNS(map_test MAP <STRING, array <STRING>>, struct_test STRUCT <f1: BIGINT, f2: BIGINT>); |
| DESCRIBE iceberg_hadoop_tables; |
| ---- RESULTS |
| 'level','string','','true' |
| 'event_time','timestamp','','true' |
| 'register_time','date','','true' |
| 'message','string','','true' |
| 'price','decimal(8,1)','','true' |
| 'map_test','map<string,array<string>>','','true' |
| 'struct_test','struct<\n f1:bigint,\n f2:bigint\n>','','true' |
| ---- TYPES |
| STRING,STRING,STRING,STRING |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_tables set TBLPROPERTIES('fake_key'='fake_value'); |
| DESCRIBE FORMATTED iceberg_hadoop_tables; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| '','fake_key ','fake_value ' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_tables set OWNER USER fake_user; |
| DESCRIBE FORMATTED iceberg_hadoop_tables; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| 'OwnerType: ','USER ','NULL' |
| 'Owner: ','fake_user ','NULL' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_tables set OWNER ROLE fake_role; |
| DESCRIBE FORMATTED iceberg_hadoop_tables; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| 'OwnerType: ','ROLE ','NULL' |
| 'Owner: ','fake_role ','NULL' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| CREATE TABLE iceberg_hadoop_catalog( |
| level STRING |
| ) |
| STORED AS ICEBERG |
| TBLPROPERTIES('iceberg.catalog'='hadoop.catalog', |
| 'iceberg.catalog_location'='/$DATABASE/hadoop_catalog_test'); |
| ALTER TABLE iceberg_hadoop_catalog ADD COLUMNS(event_time TIMESTAMP, register_time DATE); |
| ALTER TABLE iceberg_hadoop_catalog ADD COLUMNS(message STRING, price DECIMAL(8,1)); |
| ALTER TABLE iceberg_hadoop_catalog ADD COLUMNS(map_test MAP <STRING, array <STRING>>, struct_test STRUCT <f1: BIGINT, f2: BIGINT>); |
| DESCRIBE iceberg_hadoop_catalog; |
| ---- RESULTS |
| 'level','string','','true' |
| 'event_time','timestamp','','true' |
| 'register_time','date','','true' |
| 'message','string','','true' |
| 'price','decimal(8,1)','','true' |
| 'map_test','map<string,array<string>>','','true' |
| 'struct_test','struct<\n f1:bigint,\n f2:bigint\n>','','true' |
| ---- TYPES |
| STRING,STRING,STRING,STRING |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_catalog set TBLPROPERTIES('test_key'='test_value'); |
| DESCRIBE FORMATTED iceberg_hadoop_catalog; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| '','test_key ','test_value ' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_catalog set OWNER USER fake_user; |
| DESCRIBE FORMATTED iceberg_hadoop_catalog; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| 'OwnerType: ','USER ','NULL' |
| 'Owner: ','fake_user ','NULL' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_hadoop_catalog set OWNER ROLE fake_role; |
| DESCRIBE FORMATTED iceberg_hadoop_catalog; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| 'OwnerType: ','ROLE ','NULL' |
| 'Owner: ','fake_role ','NULL' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| CREATE TABLE iceberg_rename (i int) |
| STORED AS ICEBERG |
| TBLPROPERTIES('iceberg.catalog'='hive.catalog'); |
| INSERT INTO iceberg_rename values (42); |
| ALTER TABLE iceberg_rename RENAME TO iceberg_rename2; |
| SELECT * FROM iceberg_rename2; |
| ---- RESULTS |
| 42 |
| ---- TYPES |
| INT |
| ==== |
| ---- QUERY |
| SELECT * FROM iceberg_rename; |
| ---- CATCH |
| Could not resolve table reference: 'iceberg_rename' |
| ==== |
| ---- QUERY |
| CREATE TABLE iceberg_changing_fileformats (i int) |
| STORED AS ICEBERG |
| TBLPROPERTIES('iceberg.file_format'='orc'); |
| DESCRIBE FORMATTED iceberg_changing_fileformats; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| '','iceberg.file_format ','orc ' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_changing_fileformats set TBLPROPERTIES('iceberg.file_format'='parquet'); |
| DESCRIBE FORMATTED iceberg_changing_fileformats; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| '','iceberg.file_format ','parquet ' |
| ---- TYPES |
| string, string, string |
| ==== |
| ---- QUERY |
| INSERT INTO iceberg_changing_fileformats values (123); |
| SELECT * FROM iceberg_changing_fileformats; |
| ---- RESULTS |
| 123 |
| ---- TYPES |
| INT |
| ==== |
| ---- QUERY |
| ALTER TABLE iceberg_changing_fileformats set TBLPROPERTIES('iceberg.file_format'='ORC'); |
| ---- CATCH |
| Attempt to set Iceberg data file format to ORC |
| ==== |
| ---- QUERY |
| DESCRIBE FORMATTED iceberg_changing_fileformats; |
| ---- RESULTS: VERIFY_IS_SUBSET |
| '','iceberg.file_format ','parquet ' |
| ---- TYPES |
| string, string, string |
| ==== |