Iceberg从入门到精通系列之五:Zeppelin集成iceberg,创建iceberg普通表和分区表,并插入数据

一、Zeppelin集成iceberg

  • Zeppelin支持Flink SQL
  • Flink SQL支持iceberg
  • Zeppelin集成Flink SQL后,就可以在Zeppelin上创建iceberg表了

下面演示下Zeppelin集成iceberg后,创建表,插入数据的方便性。

二、查看catalog

show catalogs;

default_catalog
hive
iceberg

三、使用数据库

use debeziumtest;

四、查看表

show tables;
productinfo

五、创建表

CREATE TABLE `productInfo` (
  `id` int,
  `productId` string,
  `name` string,
  `description` string,
  `weight` float
) 

六、插入数据

insert into iceberg.ods_stg.productInfo values(2,'1206827245738502144','scooter','Small 2-wheel scooter',3.14);

七、查询数据

select * from productInfo

2   1206827245738502144   scooter    Small 2-wheel scooter   3.140000104904175

八、创建分区表

CREATE TABLE `stu` (id int,name string, age int)
PARTITIONED BY (age)

九、分区表插入数据

insert into stu values(3,'杀sheng',16),(4,'鸣人',19)

十、查询分区表数据

select * from stu
4     鸣人      19

猜你喜欢

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