Iceberg from entry to proficiency series eight: flink sql creates Iceberg table
1. Create a database
create database iceberg_db;
use iceberg_db;
Second, create a table
create table `hive_catalog`.`default`.`sample`(
id bigint comment 'unique id',
data string
);
The table creation command supports the most commonly used flink table creation syntax, including:
- PARTITION BY(column1,column2,…): configure partitions, apache flink does not support hidden partitions.
- COMMENT 'table document': Comments for the specified table
- WITH('key'='value',…): Set table properties
desc sample
3. Create a partition table
create table sample1(id bigint,data string) partitioned by(data);
desc sample1;
Fourth, use the LIKE syntax to create a table
create table sample_like sample;
desc sample_like;
5. Create a primary key table
create table sample4(id bigint,data string,primary key (id) not enforce)