SnowflakeDest
class SnowflakeDest(
tables: SnowflakeTableNamesSpec,
if_table_exists: IfTableExistsSpec = 'append',
dest_cfg: DestCfgSpec | None = None,
)
Bases: Dest
Categories: destination
Snowflake destination for @subscriber -- one output slot per table.
Examples
Append rows to a table -- the default disposition, which accumulates across runs:
@subscriber(
destination=SnowflakeDest(
tables=["cap_append"],
if_table_exists="append",
),
input_tables=["caps_input/cap_rows"],
)
def load_append(rows: TableFrameSpec) -> TableFrameSpec:
return rows
Replace mode truncates the target before COPY INTO,
preserving the existing schema on reload:
@subscriber(
destination=SnowflakeDest(
tables=["cap_replace"],
if_table_exists="replace",
),
input_tables=["caps_input/cap_rows"],
)
def load_replace(rows: TableFrameSpec) -> TableFrameSpec:
return rows
Parameters
parameter
tablesSnowflakeTableNamesSpec (list[str])Target table names, one write slot per entry. Each is a
1-, 2- or 3-part name (table, schema.table or
database.schema.table); double-quote a part for
case-sensitive / special-char names.
parameter
if_table_existsIfTableExistsSpec (Literal['append', 'replace'])"append" (the default) adds rows;
"replace" issues TRUNCATE before COPY INTO (so
the existing schema is preserved).
parameter
dest_cfgDestCfgSpec | None (Mapping[Literal['snowflake.logging_level'], Any] | None)Optional connector config; the only supported key is
snowflake.logging_level.