構建多個關於數據庫的DataFlow組合(Nifi:Table->Table)


把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即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章