构建多个关于数据库的DataFlow组合(Nifi:Table->Table)

本文详细介绍了使用Nifi 1.9中与SQL相关的处理器构建数据流的过程,涵盖多表连接查询、批量生成多张表等场景,对比了不同方法的复用性和效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


把Nifi1.9所有与SQL有关的Processor使用一次,构建不同的dataflow,然后再去比较复用性和效率。

1.多表连接后查询(使用sql片段)—>DB

1.1 需求:将多张table的data迁移到另一张表

在这里插入图片描述
1.2 DataFlow
在这里插入图片描述
1.3 Configue
在这里插入图片描述
AvroReader
在这里插入图片描述

2.多表连接后查询(sql整句)后—>DB

2.1 需求:同1.1

2.2 DataFlow在这里插入图片描述
2.3 Configure
在这里插入图片描述
Executes provided SQL select query. Query result will be converted to Avro format. Streaming is used so arbitrarily large result sets are supported.

3.多个表分别查询的结果—>DB

3.1 需求:
在这里插入图片描述
3.2 DataFlow
在这里插入图片描述
Funnel:Funnels are used to combine the data from
many Connections into a single Connection. Connections can be configured with FlowFile Prioritizers.
Data from several Connections can be funneled into a single Connection,
providing the ability to Prioritize all of the data on that one Connection,
rather than prioritizing the data on each Connection independently.

3.3 Configure

略,同1.3 的QDT

4.同一个数据库不同schema批量生成多张表

4.1 需求:无需提前在DB建表,利用Processor建表
在这里插入图片描述
4.2 DtafFlow在这里插入图片描述
ListDatabaseTables: Generates a set of flow files, each containing attributes corresponding to metadata about a table from a database connection. GenerateTableFetch:Generates SQL select queries that fetch “pages” of rows from a table.

4.3 Configure
在这里插入图片描述
在这里插入图片描述

5.补充

以上是在同一个DB不同的table,不同DB只需配置不同的JDBC即可

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值