입문에서 숙련도 시리즈 8까지의 Iceberg: flink SQL은 Iceberg 테이블을 생성합니다.
1. 데이터베이스 생성
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
3. 파티션 테이블 생성
create table sample1(id bigint,data string) partitioned by(data);
desc sample1;
넷째, LIKE 구문을 사용하여 테이블 생성
create table sample_like sample;
desc sample_like;
5. 기본 키 테이블 생성
create table sample4(id bigint,data string,primary key (id) not enforce)