Iceberg从入门到精通系列之八:flink sql 创建Iceberg表

Iceberg从入门到精通系列之八:flink sql 创建Iceberg表

一、创建数据库

create database iceberg_db;
use iceberg_db;

二、创建表

create table `hive_catalog`.`default`.`sample`(
id bigint comment 'unique id',
data string
);

建表命令支持最常用的flink建表语法,包括:

  • PARTITION BY(column1,column2,…):配置分区,apache flink不支持隐藏分区。
  • COMMENT ‘table document’:指定表的备注
  • WITH(‘key’=‘value’,…):设置表属性
desc sample

三、创建分区表

create table sample1(id bigint,data string) partitioned by(data);

desc sample1;

四、使用LIKE语法建表

create table sample_like sample;


desc sample_like;

五、创建主键表

create table sample4(id bigint,data string,primary key (id) not enforce)

猜你喜欢

转载自blog.csdn.net/zhengzaifeidelushang/article/details/131473258