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.

태그

database, insert, put, rdbms, relational, sql, update

입력 요구 사항

REQUIRED

민감한 동적 속성 지원

false

속성

속성

설명

Batch Size

단일 트랜잭션에서 데이터베이스에 넣을 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로 설정된 경우, 해당 식별자가 있는 모든 FlowFiles 을 ‘실패’ 관계로 전송하기 전에 특정 fragment.identifier 특성이 도착할 때까지 모든 FlowFiles 을 기다릴 시간을 지정합니다

database-session-autocommit

사용 중인 데이터베이스 연결에 설정할 자동 커밋 모드입니다. false로 설정하면 작업이 명시적으로 커밋되거나 롤백되며(각각 성공 또는 실패에 따라), true로 설정하면 드라이버/데이터베이스가 커밋/롤백을 처리합니다.

putsql-sql-statement

실행할 SQL 문. 문은 비어 있거나 상수 값일 수도 있고 표현식 언어를 사용하여 특성으로 작성할 수도 있습니다. 이 속성을 지정하면 수신 FlowFiles 의 내용에 관계없이 사용됩니다. 이 속성이 비어 있으면 수신 FlowFile 의 내용에는 프로세서가 데이터베이스에 발행할 유효한 SQL 문이 포함되어야 합니다.

실패 시 롤백

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.

관계

이름

설명

실패

데이터베이스 쿼리가 잘못되었거나 무결성 제약 조건을 위반하는 등 데이터베이스가 업데이트될 수 없고 작업을 다시 시도해도 실패하는 경우 FlowFile 은 관계로 라우팅됩니다

retry

데이터베이스를 업데이트할 수 없지만 작업을 다시 시도하면 성공할 수 있는 경우 FlowFile 은 관계로 라우팅됩니다

성공

데이터베이스가 성공적으로 업데이트되면 FlowFile 은 이 관계로 라우팅됩니다

Writes 특성

이름

설명

sql.generated.key

데이터베이스에서 INSERT 문에 대한 키를 생성하고 생성된 키 가져오기 속성이 true로 설정된 경우 이 특성이 추가되어 생성된 키를 표시합니다(가능한 경우). 이 기능은 모든 데이터베이스 공급업체에서 지원되는 것은 아닙니다.