GenerateTableFetch 2025.10.2.19¶
번들¶
org.apache.nifi | nifi-standard-nar
설명¶
Generates SQL select queries that fetch “pages” of rows from a table. The partition size property, along with the table ‘s row count, determine the size and number of pages and generated FlowFiles. In addition, incremental fetching can be achieved by setting Maximum-Value Columns, which causes the processor to track the columns’ maximum values, thus only fetching rows whose columns ‘values exceed the observed maximums. This processor is intended to be run on the Primary Node only. This processor can accept incoming connections; the behavior of the processor is different whether incoming connections are provided: - If no incoming connection(s) are specified, the processor will generate SQL queries on the specified processor schedule. Expression Language is supported for many fields, but no FlowFile attributes are available. However the properties will be evaluated using the Environment/System properties. - If incoming connection(s) are specified and no FlowFile is available to a processor task, no work will be performed. - If incoming connection(s) are specified and a FlowFile is available to a processor task, the FlowFile’s attributes may be used in Expression Language for such fields as Table Name and others. However, the Max-Value Columns and Columns to Return fields must be empty or refer to columns that are available in each specified table.
입력 요구 사항¶
ALLOWED
민감한 동적 속성 지원¶
false
속성¶
속성 |
설명 |
|---|---|
반환할 열 |
쿼리에 사용할 열 이름의 쉼표로 구분된 목록입니다. 데이터베이스에서 이름에 특별한 처리(예: 인용 등)가 필요한 경우 각 이름에 이러한 처리를 포함해야 합니다. 열 이름을 제공하지 않으면 지정된 테이블의 모든 열이 반환됩니다. NOTE: 증분 가져오기가 제대로 작동하려면 지정된 테이블에 일관된 열 이름을 사용하는 것이 중요합니다. |
Database Connection Pooling Service |
데이터베이스에 대한 연결을 얻는 데 사용되는 컨트롤러 서비스입니다. |
데이터베이스 언어 서비스 |
특정 서비스 또는 공급업체와 관련된 문을 생성하기 위한 데이터베이스 언어 서비스입니다. |
최대 대기 시간 |
실행 중인SQL select 쿼리에 허용되는 최대 시간이며, 0은 제한이 없음을 의미합니다. 최대 시간이 1초 미만이면 0이 됩니다. |
최대값 열 |
A comma-separated list of column names. The processor will keep track of the maximum value for each column that has been returned since the processor started running. Using multiple columns implies an order to the column list, and each column ‘s values are expected to increase more slowly than the previous columns’ values. Thus, using multiple columns implies a hierarchical structure of columns, which is usually used for partitioning tables. This processor can be used to retrieve only those rows that have been added/updated since the last retrieval. Note that some JDBC types such as bit/boolean are not conducive to maintaining maximum value, so columns of these types should not be listed in this property, and will result in error(s) during processing. If no columns are provided, all rows from the table will be considered, which could have a performance impact. NOTE: It is important to use consistent max-value column names for a given table for incremental fetch to work properly. |
테이블 이름 |
쿼리할 데이터베이스 테이블의 이름입니다. |
db-fetch-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. |
db-fetch-where-clause |
SQL 쿼리를 작성할 때 WHERE 조건에 추가할 사용자 정의 절입니다. |
gen-table-column-for-val-partitioning |
파티션 지정에 값이 사용될 열의 이름입니다. 기본 동작은 오프셋/제한 전략을 사용하여 데이터베이스에서 가져올 ‘페이지’로 파티션하기 위해 결과 세트의 행 번호를 사용하는 것입니다. 그러나 특정 데이터베이스의 경우 열 값 자체를 사용하여’페이지’를 정의하는 것이 적절한 상황에서 더 효율적일 수 있습니다. 이 속성은 기본값 쿼리의 성능이 좋지 않은 경우, 최대값 열이 없거나 유형을 긴 정수로 강제할 수 있는 단일 최대값 열이 있는 경우(즉, 날짜나 타임스탬프가 아닌), 열 값이 희소하지 않고 고르게 분포되어 있어야 최상의 성능을 발휘할 수 있는 경우에만 사용해야 합니다. |
gen-table-custom-orderby-column |
최대값 열이 제공되지 않고 파티션이 활성화된 경우 결과 순서를 지정하는 데 사용할 열의 이름입니다. Max-Value Columns이 설정되어 있거나 Partition Size가 0인 경우 이 속성은 무시됩니다. 참고: 최대 값 열이나 사용자 정의 ORDER BY 열이 설정되지 않은 경우 데이터베이스/드라이버에 따라 프로세서가 오류를 보고하거나 생성된 SQL 에 행이 누락 및/또는 중복될 수 있습니다. 명시적 순서를 지정하지 않으면 각 파티션을 임의의 순서로 가져오기 때문입니다. |
gen-table-fetch-partition-size |
생성된 각 SQL 문이 가져올 결과 행 수입니다. 테이블의 총 행 수를 파티션 크기로 나누면 생성된 SQL 문(예: FlowFiles)의 수를 알 수 있습니다. 값이 0이면 SQL 문이 테이블의 모든 행을 가져오는 단일 FlowFile 이 생성됨을 나타냅니다. |
gen-table-output-flowfile-on-zero-results |
지정된 속성에 따라 이 프로세서를 실행하면 SQL 문이 생성되지 않을 수 있습니다. 이 속성이 true이면 빈 FlowFile (있는 경우 수신 FlowFile 의 상위 항목)가 생성되어 ‘성공’ 관계로 전송됩니다. 이 속성이 false가면 FlowFiles 출력이 생성되지 않습니다. |
상태 관리¶
범위 |
설명 |
|---|---|
CLUSTER |
지정된 테이블에서 쿼리 성능을 수행한 후 지정된 열의 최대값은 향후 쿼리 실행에 사용할 수 있도록 유지됩니다. 이렇게 하면 프로세서는 최대값이 보존된 값보다 큰 레코드만 가져올 수 있습니다. 증분 가져오기, 새로 추가된 행 가져오기 등에 사용할 수 있습니다. 최대 값을 지우려면 상태 관리 설명서에 따라 프로세서의 상태를 지우십시오 |
관계¶
이름 |
설명 |
|---|---|
실패 |
이 관계는 SQL 쿼리 실행(수신 FlowFile)이 실패한 경우에만 사용됩니다. 수신 FlowFile은 불이익을 받고 이 관계로 라우팅됩니다 수신 연결이 지정되지 않으면 이 관계는 사용되지 않습니다. |
성공 |
SQL 쿼리 결과 세트에서 FlowFile 을 성공적으로 생성했습니다. |
Writes 특성¶
이름 |
설명 |
|---|---|
generatetablefetch.sql.error |
프로세서에 수신 연결이 있고 수신 FlowFile 을 처리하면 SQL 예외가 발생하는 경우 FlowFile 이 실패로 라우팅되고 이 특성이 예외 메시지로 설정됩니다. |
generatetablefetch.tableName |
쿼리할 데이터베이스 테이블의 이름입니다. |
generatetablefetch.columnNames |
쿼리에 사용되는 열 이름의 쉼표로 구분된 목록입니다. |
generatetablefetch.whereClause |
Where 절은 쿼리에서 예상 행을 가져오는 데 사용됩니다. |
generatetablefetch.maxColumnNames |
프로세서 실행이 시작된 이후 반환된 데이터를 추적하는 데 사용되는 쉼표로 구분된 열 이름 목록입니다. |
generatetablefetch.limit |
SQL 문으로 가져올 결과 행의 수입니다. |
생성 테이블 가져 오기 오프셋 |
해당 파티션을 검색하는 데 사용할 오프셋입니다. |
fragment.identifier |
동일한 쿼리 결과 세트에서 생성된 모든 FlowFiles 은 fragment.identifier 특성에 대해 동일한 값을 갖습니다. 그런 다음 결과를 상호 연관시키는 데 사용할 수 있습니다. |
fragment.count |
이것은 단일 ResultSet 에서 생성된 FlowFiles 의 총 개수입니다. 이는 동일한 수신 ResultSet 에 속하는 FlowFiles 의 수를 파악하기 위해 fragment.identifier 특성과 함께 사용할 수 있습니다. |
fragment.index |
다음은 모두 동일한 실행에서 생성된 발신 FlowFiles 목록에서 이 FlowFile 의 위치입니다. 이것은 fragment.식별자 특성과 함께 사용하여 동일한 실행에서 어떤 FlowFiles 이 생성되었는지, 어떤 순서로 FlowFiles 이 생성되었는지 알 수 있습니다 |