PutDatabaseRecord 2025.10.2.19¶
번들¶
org.apache.nifi | nifi-standard-nar
설명¶
The PutDatabaseRecord processor uses a specified RecordReader to input (possibly multiple) records from an incoming flow file. These records are translated to SQL statements and executed as a single transaction. If any errors occur, the flow file is routed to failure or retry, and if the records are transmitted successfully, the incoming flow file is routed to success. The type of statement executed by the processor is specified via the Statement Type property, which accepts some hard-coded values such as INSERT, UPDATE, and DELETE, as well as ‘Use statement.type Attribute’, which causes the processor to get the statement type from a flow file attribute. IMPORTANT: If the Statement Type is UPDATE, then the incoming records must not alter the value(s) of the primary keys (or user-specified Update Keys). If such records are encountered, the UPDATE statement issued to the database may do nothing (if no existing records with the new primary key values are found), or could inadvertently corrupt the existing data (by changing records for which the new values of the primary keys exist).
입력 요구 사항¶
REQUIRED
민감한 동적 속성 지원¶
false
속성¶
속성 |
설명 |
|---|---|
열 이름 변환 패턴 |
열 이름은 다음 정규식으로 정규화됩니다 |
Column Name Translation Strategy |
테이블 열 이름을 정규화하는 데 사용되는 전략입니다. 전략에 관계없이 대/소문자를 구분하지 않는 매칭을 수행하기 위해 열 이름이 대문자로 표시됩니다 |
데이터 레코드 경로 |
지정하면 이 속성은 수신 각 레코드에 대해 평가할 RecordPath 를 나타내며, RecordPath 를 평가한 결과의 레코드는 수신 전체 레코드를 보내는 대신 데이터베이스로 전송됩니다. 지정하지 않으면 수신 전체 레코드가 데이터베이스에 게시됩니다. |
데이터베이스 언어 서비스 |
특정 서비스 또는 공급업체와 관련된 문을 생성하기 위한 데이터베이스 언어 서비스입니다. |
키 삭제 |
데이터베이스에서 DELETE 문에 대한 행을 고유하게 식별하는 쉼표로 구분된 열 이름의 목록입니다. 문 유형이 DELETE 이고 이 속성이 설정되지 않은 경우 테이블의 열이 사용됩니다. 이 속성은 Statement Type이 DELETE 가 아닌 경우 무시됩니다 |
문 유형 레코드 경로 |
문 유형을 결정하기 위해 각 레코드에 대해 평가할RecordPath 를 지정합니다. RecordPath 는 INSERT, UPDATE 또는 DELETE 와 같아야 합니다. (Debezium 스타일 연산 유형도 지원됨: INSERT 의 경우 “r” 및 “c”, UPDATE 의 경우 “u”, DELETE 의 경우 “d”) |
database-session-autocommit |
사용 중인 데이터베이스 연결에 설정할 자동 커밋 모드입니다. false로 설정하면 작업은 명시적으로 커밋되거나 롤백됩니다(각각 성공 또는 실패에 따라). true로 설정하면 드라이버/데이터베이스가 자동으로 커밋/롤백을 처리합니다. |
db-type |
Database Type for generating statements specific to a particular service or vendor. The Generic Type supports most cases but selecting a specific type enables optimal processing or additional features. |
put-db-record-allow-multiple-statements |
문 유형이 ‘SQL’(statement.type 특성에 설정된 대로)인 경우 이 필드는 필드 값을 세미콜론으로 분할하여 각 문을 개별적으로 실행할지 여부를 나타냅니다. 오류를 일으키는 문이 있으면 전체 문이 롤백됩니다. 문 유형이 ‘SQL’이 아닌 경우 이 필드는 무시됩니다. |
put-db-record-binary-format |
문자열 값을 바이너리로 디코딩할 때 적용할 형식입니다. |
put-db-record-catalog-name |
The name of the database (or the name of the catalog, depending on the destination system) that the statement should update. This may not apply for the database that you are updating. In this case, leave the field empty. Note that if the property is set and the database is case-sensitive, the catalog name must match the database’s catalog name exactly. |
put-db-record-dcbp-service |
레코드를 전송하기 위해 데이터베이스에 대한 연결을 얻는 데 사용되는 컨트롤러 서비스입니다. |
put-db-record-field-containing-sql |
문 유형이 ‘SQL’(statement.type 특성에 설정된 대로)인 경우 이 필드는 실행할 SQL 문이 포함된 레코드의 필드를 나타냅니다. 필드 값은 단일 SQL 문이어야 합니다. 문 유형이 ‘SQL’이 아닌 경우 이 필드는 무시됩니다. |
put-db-record-max-batch-size |
데이터베이스에 전송되는 각 배치에 포함할 최대 SQL 문 수를 지정합니다. 0은 배치 크기에 제한이 없으며 모든 문이 단일 배치에 배치되므로 매우 많은 수의 문에 대해 높은 메모리 사용 문제가 발생할 수 있습니다. |
put-db-record-query-timeout |
실행 중인 SQL 문에 허용되는 최대 시간이며, 0은 제한이 없음을 의미합니다. 최대 시간이 1초 미만이면 0이 됩니다. |
put-db-record-quoted-identifiers |
이 옵션을 활성화하면 모든 열 이름이 따옴표로 묶여 테이블에서 예약어를 열 이름으로 사용할 수 있습니다. |
put-db-record-quoted-table-identifiers |
이 옵션을 활성화하면 테이블 이름에 특수 문자를 사용할 수 있도록 테이블 이름이 따옴표로 묶입니다. |
put-db-record-record-reader |
수신 데이터를 구문 분석하고 데이터의 스키마를 결정하는 데 사용할 컨트롤러 서비스를 지정합니다. |
put-db-record-schema-name |
테이블이 속한 스키마의 이름입니다. 업데이트 중인 데이터베이스에는 적용되지 않을 수 있습니다. 이 경우 필드를 비워 두십시오. 속성이 설정되어 있고 데이터베이스가 대/소문자를 구분하는 경우 스키마 이름이 데이터베이스의 스키마 이름과 정확히 일치해야 한다는 점에 유의하십시오. |
put-db-record-statement-type |
Specifies the type of SQL Statement to generate. Please refer to the database documentation for a description of the behavior of each operation. Please note that some Database Types may not support certain Statement Types. If ‘Use statement.type Attribute’ is chosen, then the value is taken from the statement.type attribute in the FlowFile. The ‘Use statement.type Attribute’ option is the only one that allows the ‘SQL’statement type. If ‘SQL’ is specified, the value of the field specified by the ‘Field Containing SQL’ property is expected to be a valid SQL statement on the target database, and will be executed as-is. |
put-db-record-table-name |
문이 영향을 미칠 테이블의 이름입니다. 데이터베이스가 대/소문자를 구분하는 경우 테이블 이름은 데이터베이스의 테이블 이름과 정확히 일치해야 합니다. |
put-db-record-translate-field-names |
true이면 프로세서는 필드 이름을 지정된 테이블에 적합한 열 이름으로 변환하려고 시도합니다. false인 경우 필드 이름이 열 이름과 정확히 일치해야 하며, 그렇지 않으면 열이 업데이트되지 않습니다 |
put-db-record-unmatched-column-behavior |
수신 레코드에 모든 데이터베이스 테이블의 열에 대한 필드 매핑이 없는 경우 이 속성은 상황을 처리하는 방법을 지정합니다 |
put-db-record-unmatched-field-behavior |
수신 레코드에 데이터베이스 테이블의 열에 매핑되지 않는 필드가 있는 경우 이 속성은 상황을 처리하는 방법을 지정합니다 |
put-db-record-update-keys |
데이터베이스에서 UPDATE 문에 대한 행을 고유하게 식별하는 쉼표로 구분된 열 이름의 목록입니다. Statement Type이 UPDATE 이고 이 속성이 설정되지 않은 경우 테이블의 기본 키가 사용됩니다. 이 경우 일치하지 않는 열 동작이 FAIL 로 설정된 경우 기본 키가 존재하지 않으면 SQL 로의 변환이 실패합니다. Statement Type이 INSERT 인 경우 이 속성은 무시됩니다 |
실패 시 롤백 |
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. |
table-schema-cache-size |
캐시할 테이블 스키마 수를 지정합니다 |
관계¶
이름 |
설명 |
|---|---|
실패 |
데이터베이스 쿼리가 잘못되었거나 무결성 제약 조건을 위반하는 등 데이터베이스가 업데이트될 수 없고 작업을 다시 시도해도 실패하는 경우 FlowFile 은 관계로 라우팅됩니다 |
retry |
데이터베이스를 업데이트할 수 없지만 작업을 다시 시도하면 성공할 수 있는 경우 FlowFile 은 관계로 라우팅됩니다 |
성공 |
SQL 쿼리 결과 세트에서 FlowFile 을 성공적으로 생성했습니다. |
Writes 특성¶
이름 |
설명 |
|---|---|
putdatabaserecord.error |
처리 중에 오류가 발생하면 플로우 파일이 실패 또는 재시도로 라우팅되며, 이 특성은 오류의 원인으로 채워집니다. |
사용 사례¶
데이터베이스에 레코드 삽입하기 |