syntax
Parameters
| Parameter or clause | Description |
|---|---|
| sink_name | The name of the sink. If a schema name is given (for example, CREATE SINK <schema>.<sink> ...), then the sink is created in the specified schema. Otherwise it is created in the current schema. |
| col_name | The corresponding table columns in the sink result. For those columns not listed, it will be inserted as the default value defined in the table. |
WITH clause | You can use options such as type = 'append-only' and force_append_only = 'true' to explicitly control the append-only behavior. |
A table without a primary key can only accept the append-only sink.
You can use
ALTER TABLE ... ADD COLUMN to add columns to a table that has sinks.Enable sink decoupling
Added in v2.5.0. It is currently in technical preview stage.
CREATE SINK INTO. To enable it, set sink_decouple = true before creating the sink.
Examples
You can union data from two different Kafka topics.Troubleshooting
CREATE SINK ... INTOaligns rows to be inserted based on column order, not column names. If you see data correctness issues, verify that the column order in theSELECTlist matches the target table.- The sink target table may have a different primary key than the upstream table. If primary keys overlap downstream, rows can be overwritten. This can make your downstream table have fewer rows than your upstream table.