Using the Impala shell
Using Impala, you can create an Iceberg table followed by Schema evolution, partition specification, partition evolution and CTAS operation.
Run the following command in your Impala shell to create a new Iceberg table
-
CREATE TABLE ice_t (i INT) STORED AS ICEBERG;
-
Navigate accordingly in the Atlas UI to view the changes.
The following images provide information about Iceberg table creation process.Run the following command in your Impala shell to create a scheme evolution:
-
CREATE TABLE ice_t_2 (i INT) STORED AS ICEBERG;
Run the following command in your Impala shell to add a column to the existing table (ice_t_2):
-
alter table ice_t_2 ADD COLUMNS (add_col_1 string );
Run the following command in your Impala shell to create a partition specification.
-
CREATE TABLE ice_part_spec (s string , b string ) PARTITIONED BY SPEC
(truncate(3, s)) STORED AS ICEBERG ;
Run the following command in your Impala shell to create a partition evolution.
-
CREATE TABLE ice_p (i INT, d DATE, s STRING, t TIMESTAMP) PARTITIONED BY SPEC
(BUCKET(5, i), MONTH(d), TRUNCATE(3, s), HOUR(t))STORED AS ICEBERG;
Run the following command in your Impala shell to modify the partition specification
-
ALTER TABLE ice_p SET PARTITION SPEC (VOID(i), VOID(d), TRUNCATE(3, s),
HOUR(t), i);
Run the following commands in your Impala shell to create the contents of one table (ice_t_3) to another table (ice_t_4).
-
CREATE TABLE ice_t_3 (i INT) STORED AS ICEBERG;
-
CREATE TABLE ice_t_4 STORED AS ICEBERG as select * from ice_t_3;
The process is completed.