PutSQL 2025.10.2.19

バンドル

org.apache.nifi | nifi-standard-nar

説明

Executes a SQL UPDATE or INSERT command. The content of an incoming FlowFile is expected to be the SQL command to execute. The SQL command may use the ? to escape parameters. In this case, the parameters to use must exist as FlowFile attributes with the naming convention sql.args. N.type and sql.args. N.value, where N is a positive integer. The sql.args. N.type is expected to be a number indicating the JDBC Type. The content of the FlowFile is expected to be in UTF-8 format.

タグ

データベース、挿入、配置、rdbms、リレーショナル、SQL、更新

入力要件

REQUIRED

機密動的プロパティをサポート

false

プロパティ

プロパティ

説明

バッチサイズ

1回のトランザクションでデータベースに保存する FlowFiles の数。

JDBC 接続プール

JSON メッセージを SQL ステートメントに変換するために使用する JDBC 接続プールを指定します。接続プールは、適切なデータベース列タイプを決定するために必要です。

生成キーの取得

trueの場合、データベースによって自動的に生成されたキーは、sql.generate.key属性を使用して、それを生成した FlowFile に追加されます。これによりパフォーマンスが若干低下する可能性があり、すべてのデータベースでサポートされているわけではありません。

断片化されたトランザクションのサポート

If true, when a FlowFile is consumed by this Processor, the Processor will first check the fragment.identifier and fragment.count attributes of that FlowFile. If the fragment.count value is greater than 1, the Processor will not process any FlowFile with that fragment.identifier until all are available; at that point, it will process all FlowFiles with that fragment.identifier as a single transaction, in the order specified by the FlowFiles 'fragment.index attributes. This Provides atomicity of those SQL statements. Once any statement of this transaction throws exception when executing, this transaction will be rolled back. When transaction rollback happened, none of these FlowFiles would be routed to'success '. If the <Rollback On Failure> is set true, these FlowFiles will stay in the input relationship. When the <Rollback On Failure> is set false,, if any of these FlowFiles will be routed to' retry ', all of these FlowFiles will be routed to' retry '.Otherwise, they will be routed to' failure'. If this value is false, these attributes will be ignored and the updates will occur independent of one another.

トランザクションタイムアウト

<Support Fragmented Transactions> プロパティがtrueにセットされている場合、特定のfragment.identifier属性のすべての FlowFiles は、その識別子を持つすべての FlowFiles を 'failure' 関係に転送する前に到着するまでの待ち時間を指定します。

database-session-autocommit

使用するデータベース接続にセットする自動コミットモード。false にセットすると、操作は明示的にコミットまたはロールバックされます (それぞれ成功または失敗に基づいて)。trueにセットすると、ドライバー/データベースがコミット/ロールバックを操作します。

putsql-sql-statement

実行する SQL ステートメント。ステートメントは空でも、定数値でも、式言語を使って属性から構築することもできます。このプロパティが指定された場合、受信 FlowFiles の内容に関係なく使用されます。このプロパティが空の場合、受信する FlowFile のコンテナーには有効な SQL ステートメントが含まれ、プロセッサーからデータベースに対して発行されることが期待されます。

rollback-on-failure

Specify how to handle error. By default (false), if an error occurs while processing a FlowFile, the FlowFile will be routed to 'failure' or 'retry' relationship based on error type, and processor can continue with next FlowFile. Instead, you may want to rollback currently processed FlowFiles and stop further processing immediately. In that case, you can do so by enabling this 'Rollback On Failure' property. If enabled, failed FlowFiles will stay in the input relationship without penalizing it and being processed repeatedly until it gets processed successfully or removed by other means. It is important to set adequate 'Yield Duration' to avoid retrying too frequently.

リレーションシップ

名前

説明

failure

FlowFile は、データベースを更新できず、無効なクエリや整合性制約違反など、操作を再試行しても失敗する場合は、このリレーションシップにルーティングされます。

retry

データベースを更新できない場合、 FlowFile はこのリレーションシップにルーティングされますが、再度操作を試みると成功する可能性があります。

success

データベースが正常に更新されると、このリレーションシップに FlowFile がルーティングされます。

属性の書き込み

名前

説明

sql.generated.key

データベースが INSERT ステートメントのキーを生成し、Obtain Generated Keys プロパティが true にセットされている場合、可能であれば、生成されたキーを示すためにこの属性が追加されます。この機能は、すべてのデータベースベンダーがサポートしているわけではありません。