RecordReaderFactory
Implementations: CEFReader
SyslogReader
ReaderLookup
ProtobufReader
Syslog5424Reader
CSVReader
GrokReader
WindowsEventLogReader
ScriptedReader
AvroReader
ParquetReader
JsonPathReader
ExcelReader
JsonTreeReader
YamlTreeReader
XMLReader
The service for reading incoming flow files. The reader is only used to determine the schema of the records, the actual records will not be processed. | Database Connection Pooling Service | updatedatabasetable-dbcp-service | | Controller Service API: DBCPService Implementations: HikariCPConnectionPool HadoopDBCPConnectionPool DBCPConnectionPool DBCPConnectionPoolLookup | The Controller Service that is used to obtain connection(s) to the database |
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. |
Catalog Name | updatedatabasetable-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 | updatedatabasetable-schema-name | | | The name of the database 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 | updatedatabasetable-table-name | | | The name of the database table to update. If the table does not exist, then it will either be created or an error thrown, depending on the value of the Create Table property. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Create Table Strategy | updatedatabasetable-create-table | Fail If Not Exists | - Create If Not Exists
- Fail If Not Exists
| Specifies how to process the target table when it does not exist (create it, fail, e.g.). |
Primary Key Fields | updatedatabasetable-primary-keys | | | A comma-separated list of record field names that uniquely identifies a row in the database. This property is only used if the specified table needs to be created, in which case the Primary Key Fields will be used to specify the primary keys of the newly-created table. IMPORTANT: Primary Key Fields must match the record field names exactly unless 'Quote Column Identifiers' is false and the database allows for case-insensitive column names. In practice it is best to specify Primary Key Fields that exactly match the record field names, and those will become the column names in the created table. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
This Property is only considered if the [Create Table Strategy] Property has a value of "Create If Not Exists". |
Translate Field Names | updatedatabasetable-translate-field-names | true | | If true, the Processor will attempt to translate field names into the corresponding column names for the table specified, for the purposes of determining whether the field name exists as a column in the target table. NOTE: If the target table does not exist and is to be created, this property is ignored and the field names will be used as-is. If false, the field names must match the column names exactly, or the column may not be found and instead an error my be reported that the column already exists. |
Update Field Names | updatedatabasetable-update-field-names | false | | This property indicates whether to update the output schema such that the field names are set to the exact column names from the specified table. This should be used if the incoming record field names may not match the table's column names in terms of upper- and lower-case. For example, this property should be set to true if the output FlowFile is destined for Oracle e.g., which expects the field names to match the column names exactly. NOTE: The value of the 'Translate Field Names' property is ignored when updating field names; instead they are updated to match the column name as returned by the database. |
Record Writer | updatedatabasetable-record-writer | | Controller Service API: RecordSetWriterFactory Implementations: JsonRecordSetWriter RecordSetWriterLookup AvroRecordSetWriter XMLRecordSetWriter FreeFormTextRecordSetWriter CSVRecordSetWriter ParquetRecordSetWriter ScriptedRecordSetWriter | Specifies the Controller Service to use for writing results to a FlowFile. The Record Writer should use Inherit Schema to emulate the inferred schema behavior, i.e. an explicit schema need not be defined in the writer, and will be supplied by the same logic used to infer the schema from the column types. If Create Table Strategy is set 'Create If Not Exists', the Record Writer's output format must match the Record Reader's format in order for the data to be placed in the created table location. Note that this property is only used if 'Update Field Names' is set to true and the field names do not all match the column names exactly. If no update is needed for any field names (or 'Update Field Names' is false), the Record Writer is not used and instead the input FlowFile is routed to success or failure without modification.
This Property is only considered if the [Update Field Names] Property has a value of "true". |
Quote Table Identifiers | updatedatabasetable-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 and/or forcing the value of the Table Name property to match the target table name exactly. |
Quote Column Identifiers | updatedatabasetable-quoted-column-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 and/or forcing the record field names to match the column names exactly. |
Query Timeout | updatedatabasetable-query-timeout | 0 | | Sets the number of seconds the driver will wait for a query to execute. A value of 0 means no timeout. NOTE: Non-zero values may not be supported by the driver. Supports Expression Language: true (will be evaluated using flow file attributes and variable registry) |
Relationships:
Name | Description |
---|
success | A FlowFile containing records routed to this relationship after the record has been successfully transmitted to the database. |
failure | A FlowFile containing records routed to this relationship if the record could not be transmitted to the database. |
Reads Attributes:
None specified.Writes Attributes:
Name | Description |
---|
output.table | This attribute is written on the flow files routed to the 'success' and 'failure' relationships, and contains the target table name. |
output.path | This attribute is written on the flow files routed to the 'success' and 'failure' relationships, and contains the path on the file system to the table (or partition location if the table is partitioned). |
mime.type | Sets the mime.type attribute to the MIME Type specified by the Record Writer, only if a Record Writer is specified and Update Field Names is 'true'. |
record.count | Sets the number of records in the FlowFile, only if a Record Writer is specified and Update Field Names is 'true'. |
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.