INFO-通过实时开发DDL任务创建pamion表并用于实时计算
更新时间: 2025-12-05 20:22:44
阅读 43
INFO-通过实时开发DDL任务创建pamion表并用于实时计算
适用模块
实时开发具体说明
1. 本文档介绍如何使用实时开发模块通过DDL任务创建出pamion表并用于实时计算2. 当前Pamion表仅支持通过实时DDL任务创建,无法通过自助分析等其他模块创建
3. 需保证建表所依赖的hdfs路径,平台账号/项目账号拥有读写权限
4. 通过实时开发DDL任务创建出来的pamion表不支持增删改
5. DDL任务Flink引擎必须为Flink 1.18版本,插件为1.4.15+版本
6. Flink Paimon Connector 官方文档:https://paimon.apache.org/docs/0.8/flink/quick-start/
使用示例
一、创建Catalog
CREATE CATALOG pamion_test_catalog WITH (
'type'='paimon', --type: 固定为 paimon
'metastore' = 'hive', --metastore:hive,表示创建一个 Paimon Hive Catalog
'auth.method'='kerberos', --auth.method:认证方式,支持 kerberos 和 simple 两种模式
'hdfs-site'='hdfs-site.xml', --hdfs-site:依赖的 hdfs-site.xml 文件名
'core-site'='core-site.xml', --core-site:依赖的 core-site.xml 文件名
'hive-site'='hive-site.xml', --hive-site:依赖的 hive-site.xml 文件名
'krb.conf'='krb5.conf', --krb.conf:krb.conf 文件名
'krb.keytab'='sloth.keytab', --krb.keytab:krb.keytab 文件名
'krb.principal'='sloth/ALL@BDMS_DEMO.COM' --krb.principal:指定的 principal 标识符
);
其中需注意DDL语句中依赖的《各配置文件 及 keytab文件》获取方式,需在实时模块—realtime_submitter服务的节点上获取:
具体获取方式如下:
(1)hdfs-site.xml & core-site.xml & krb5.conf 文件获取方式:
路径地址:
/usr/easyops/realtime_submitter/default_realtime_submitter/cluster_config/easyops-cluster

(2)hive-site.xml 文件获取方式:
路径地址:
/usr/easyops/realtime_submitter/default_realtime_submitter/tmp/sloth/cache_file/easyops-cluster

(3)获取到上述文件后,上传至实时开发模块:

(4)在DDL任务-依赖配置内引用上述配置文件

二、创建pamion表
--基于第一步创建的catalog,创建pamion表,eg:
CREATE TABLE if not exists pamion_test_catalog.support.pamion_table_test(id BIGINT) WITH (
'connector' = 'paimon'
);三、对pamion表进行实时计算
--创建一张DataGen表用于生成数据进行测试
CREATE TABLE data_source (
id BIGINT
) WITH (
'connector' = 'datagen',
'rows-per-second' = '1'
);
--数据实时同步,读取DataGen表写入pamion表
insert into
caojun_hive_test_catalog.support.pamion_table_test
SELECT
*
FROM
data_source;四、提交运行DDL任务
(1)语法检查、保存并提交上线任务
(2)启动任务

(3)任务运行情况:

(4)flink运维页面:

(5)创建pamion表情况:

作者:曹俊
文档反馈
以上内容对您是否有帮助?