DatabaseRecordSink

Description:

Provides a service to write records using a configured database connection.

Tags:

db, jdbc, database, connection, record

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Database Connection Pooling ServiceController Service API:
DBCPService
Implementations: DBCPConnectionPool
HiveConnectionPool
DBCPConnectionPoolLookup
HadoopDBCPConnectionPool
The Controller Service that is used to obtain a connection to the database for sending records.
Catalog NameThe 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
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Schema NameThe 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
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Table NameThe name of the table that the statement should affect.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Translate Field Namestrue
  • true
  • false
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 BehaviorIgnore Unmatched Fields
  • Ignore Unmatched Fields Any field in the document that cannot be mapped to a column in the database is ignored
  • Fail on Unmatched Fields If the document has any field that cannot be mapped to a column in the database, the FlowFile will be routed to the failure relationship
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 BehaviorFail on Unmatched Columns
  • Ignore Unmatched Columns Any column in the database that does not have a field in the document will be assumed to not be required.  No notification will be logged
  • Warn on Unmatched Columns Any column in the database that does not have a field in the document will be assumed to not be required.  A warning will be logged
  • Fail on Unmatched Columns A flow will fail if any column in the database that does not have a field in the document.  An error will be logged
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
Quote Column Identifiersfalse
  • true
  • 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 Identifiersfalse
  • true
  • 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 Time0 secondsThe 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)

State management:

This component does not store state.

Restricted:

This component is not restricted.

System Resource Considerations:

None specified.