RecordReaderFactory
Implementations: JsonPathReader
Syslog5424Reader
CSVReader
JsonTreeReader
GrokReader
ExcelReader
ParquetReader
ReaderLookup
CEFReader
WindowsEventLogReader
ProtobufReader
SyslogReader
AvroReader
XMLReader
ScriptedReader
YamlTreeReader
Specifies the Controller Service to use for parsing incoming data and determining the data's schema. | Database Type | db-type | Generic | - Generic
- Oracle
- Oracle 12+
- MS SQL 2012+
- MS SQL 2008
- MySQL
- PostgreSQL
- Phoenix
| The type/flavor of database, used for generating database-specific code. In many cases the Generic type should suffice, but some databases (such as Oracle) require custom SQL clauses. |
Statement Type | put-db-record-statement-type | | - UPDATE
- INSERT
- UPSERT
- INSERT_IGNORE
- DELETE
- Use statement.type Attribute
- Use Record Path
| 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. |
Statement Type Record Path | Statement Type Record Path | | | Specifies a RecordPath to evaluate against each Record in order to determine the Statement Type. The RecordPath should equate to either INSERT, UPDATE, UPSERT, or DELETE.
This Property is only considered if the [Statement Type] Property has a value of "Use Record Path". |
Data Record Path | Data Record Path | | | If specified, this property denotes a RecordPath that will be evaluated against each incoming Record and the Record that results from evaluating the RecordPath will be sent to the database instead of sending the entire incoming Record. If not specified, the entire incoming Record will be published to the database. |
Database Connection Pooling Service | put-db-record-dcbp-service | | Controller Service API: DBCPService Implementations: HadoopDBCPConnectionPool DBCPConnectionPool DBCPConnectionPoolLookup HikariCPConnectionPool | The Controller Service that is used to obtain a connection to the database for sending records. |
Catalog Name | put-db-record-catalog-name | | | The name of the catalog 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. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Schema Name | put-db-record-schema-name | | | The name of the schema that the table belongs to. 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 schema name must match the database's schema name exactly. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Table Name | put-db-record-table-name | | | The name of the table that the statement should affect. Note that if the database is case-sensitive, the table name must match the database's table name exactly. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Binary String Format | put-db-record-binary-format | UTF-8 | | The format to be applied when decoding string values to binary. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Translate Field Names | put-db-record-translate-field-names | true | | If true, the Processor will attempt to translate field names into the appropriate column names for the table specified. If false, the field names must match the column names exactly, or the column will not be updated |
Unmatched Field Behavior | put-db-record-unmatched-field-behavior | Ignore Unmatched Fields | - Ignore Unmatched Fields
- Fail on Unmatched Fields
| If an incoming record has a field that does not map to any of the database table's columns, this property specifies how to handle the situation |
Unmatched Column Behavior | put-db-record-unmatched-column-behavior | Fail on Unmatched Columns | - Ignore Unmatched Columns
- Warn on Unmatched Columns
- Fail on Unmatched Columns
| If an incoming record does not have a field mapping for all of the database table's columns, this property specifies how to handle the situation |
Update Keys | put-db-record-update-keys | | | A comma-separated list of column names that uniquely identifies a row in the database for UPDATE statements. If the Statement Type is UPDATE and this property is not set, the table's Primary Keys are used. In this case, if no Primary Key exists, the conversion to SQL will fail if Unmatched Column Behaviour is set to FAIL. This property is ignored if the Statement Type is INSERT Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
This Property is only considered if the [Statement Type] Property is set to one of the following values: [Use statement.type Attribute], [Use Record Path], [UPSERT], [UPDATE] |
Field Containing SQL | put-db-record-field-containing-sql | | | If the Statement Type is 'SQL' (as set in the statement.type attribute), this field indicates which field in the record(s) contains the SQL statement to execute. The value of the field must be a single SQL statement. If the Statement Type is not 'SQL', this field is ignored. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
This Property is only considered if the [Statement Type] Property is set to one of the following values: [Use statement.type Attribute], [Use Record Path] |
Allow Multiple SQL Statements | put-db-record-allow-multiple-statements | false | | If the Statement Type is 'SQL' (as set in the statement.type attribute), this field indicates whether to split the field value by a semicolon and execute each statement separately. If any statement causes an error, the entire set of statements will be rolled back. If the Statement Type is not 'SQL', this field is ignored.
This Property is only considered if the [Statement Type] Property is set to one of the following values: [Use statement.type Attribute], [Use Record Path] |
Quote Column Identifiers | put-db-record-quoted-identifiers | false | | Enabling this option will cause all column names to be quoted, allowing you to use reserved words as column names in your tables. |
Quote Table Identifiers | put-db-record-quoted-table-identifiers | false | | Enabling this option will cause the table name to be quoted to support the use of special characters in the table name. |
Max Wait Time | put-db-record-query-timeout | 0 seconds | | The maximum amount of time allowed for a running SQL statement , zero means there is no limit. Max time less than 1 second will be equal to zero. Supports Expression Language: true (will be evaluated using variable registry only) |
Rollback On Failure | rollback-on-failure | false | | 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 | table-schema-cache-size | 100 | | Specifies how many Table Schemas should be cached |
Maximum Batch Size | put-db-record-max-batch-size | 1000 | | Specifies maximum number of sql statements to be included in each batch sent to the database. Zero means the batch size is not limited, and all statements are put into a single batch which can cause high memory usage issues for a very large number of statements. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Database Session AutoCommit | database-session-autocommit | false | | The autocommit mode to set on the database connection being used. If set to false, the operation(s) will be explicitly committed or rolled back (based on success or failure respectively). If set to true, the driver/database automatically handles the commit/rollback. Setting this property to 'No value' will leave the database connection's autocommit mode unmodified. |
Relationships:
Name | Description |
---|
retry | A FlowFile is routed to this relationship if the database cannot be updated but attempting the operation again may succeed |
success | Successfully created FlowFile from SQL query result set. |
failure | A FlowFile is routed to this relationship if the database cannot be updated and retrying the operation will also fail, such as an invalid query or an integrity constraint violation |
Reads Attributes:
Name | Description |
---|
statement.type | If 'Use statement.type Attribute' is selected for the Statement Type property, the value of this attribute will be used to determine the type of statement (INSERT, UPDATE, DELETE, SQL, etc.) to generate and execute. |
Writes Attributes:
Name | Description |
---|
putdatabaserecord.error | If an error occurs during processing, the flow file will be routed to failure or retry, and this attribute will be populated with the cause of the error. |
State management:
This component does not store state.Restricted:
This component is not restricted.Input requirement:
This component requires an incoming relationship.System Resource Considerations:
None specified.