UpdateSnowflakeDatabase 2025.10.9.21

Bundle

com.snowflake.openflow.runtime | runtime-snowflake-processors-nar

Description

Updates the definition of a Snowflake table based on the schema provided in the incoming FlowFile. The schema is expected to be in JSON with the following format, regardless of whether it is provided via FlowFile content or specified as a property: { “columns”: [ { “name”: “<column name>”, “type”: “<column type>”, “nullable”: <true/false>, “precision”: <precision, only for numeric type>, “scale”: <scale, only for numeric type> }, … ], “primaryKeys”: [“<name of first primary key column>”, “<name of second primary key column>”, …] }

Tags

Input Requirement

REQUIRED

Supports Sensitive Dynamic Properties

false

Properties

PropertyDescription
Add Column StrategyThe strategy to use when the incoming schema has a column that is not present in the existing table
Add Not Null StrategyThe strategy to use when the incoming schema has a not-null constraint that is not present in the existing table
Alter Column Type StrategyThe strategy to use when the existing table has a column with a different type than the incoming schema.
Column Name TransformationAn optional transformation that can be applied to the names of columns defined in the schema. This transformation is applied to the column names before they are compared to the existing columns in the table. This property can reference the following variables via Expression Language, in addition to attributes: column.name, column.type, column.nullable, column.precision, column.scale, column.primaryKey.
Column Removal StrategyThe strategy to use when the existing table has a column that is not present in the incoming schema
Connection PoolThe connection pool to use to connect to Snowflake
Create StreamWhether or not to create a Snowflake Stream for the table
Creation ParametersAdditional parameters to include in the CREATE TABLE statement. For example, ‘CLUSTER BY (column_name)’
Desired SchemaThe desired schema / table definition
Drop Column StrategyThe strategy to use when the existing table has a column that is not present in the incoming schema
Drop Not Null StrategyThe strategy to use when the existing table has a not-null constraint that is not present in the incoming schema
Include Default ValuesWhether or not to include DEFAULT values in CREATE TABLE or ALTER TABLE ADD COLUMN statements
Include Not Null ConstraintsWhether or not to include NOT NULL constraints in CREATE TABLE or ALTER TABLE ADD COLUMN statements
Include Primary Key ConstraintsWhether or not to include primary key constraints in the creation statement
Max Batch SizeThe maximum number of FlowFiles that can be processed in a single execution for a given table.
Modify Primary Key StrategyThe strategy to use when the incoming schema has a primary key that differs from the existing primary key. Modifying the Primary Key requires dropping the existing one, if any, and adding a new one.
Record ReaderRecord Reader to use for obtaining the desired schema
Removed Column Name SuffixThe suffix to append to a column that was removed. For example, to rename column ‘foo’ to ‘foo__deleted’, the property can be set to __deleted
Schema NameThe name of the schema to update
Stream Creation ParametersAdditional parameters to include in the CREATE STREAM statement. For example, ‘APPEND_ONLY=TRUE’
Stream NameThe name of the stream
Table Metadata Cache Expiration TimeThe time in seconds after which the cache entry will be removed
Table NameThe name of the table to update or create stream on
Table Schema StrategySpecifies how to obtain the desired schema / table definition
Table Stream Creation ParametersParameters to include in the CREATE STREAM statement. For example, ‘APPEND_ONLY=TRUE’. The stream will be created along with the table as it’s source.
Table Stream NameThe name of the stream created along with the table. Stream source will be the created table.
Update TypeThe type of update to perform
Use Table Metadata CacheWhether to cache table’s metadata instead of reading it directly from Snowflake. Applies to [Create Table If Not Exists, Alter Table]

Relationships

NameDescription
failureThe incoming FlowFile is routed to this relationship if the table cannot be updated
successThe incoming FlowFile is routed to this relationship after the table has been updated successfully

Writes attributes

NameDescription
schema.hashA SHA-256 hash of the final table schema after all updates have been completed. Can be used for change detection and caching purposes.