This guide will introduce how to sink data from RisingWave to JDBC-available databases using the JDBC sink connector.
Parameter or clause | Description |
---|---|
sink_name | Name of the sink to be created. |
sink_from | A clause that specifies the direct source from which data will be output. sink_from can be a materialized view or a table. Either this clause or a SELECT query must be specified. |
AS select_query | A SELECT query that specifies the data to be output to the sink. Either this query or a FROM clause must be specified. See SELECT for the syntax and examples of the SELECT command. |
connector | Sink connector type must be jdbc for MySQL sink. |
jdbc.url | Required. The JDBC URL of the destination database necessary for the driver to recognize and connect to the database. |
user | The user name for the database connection. |
password | The password for the database connection. |
jdbc.query.timeout | Specifies the timeout for the operations to downstream. If not set, the default is 60s. |
jdbc.auto.commit | Controls whether to automatically commit transactions for JDBC sink. If not set, the default is false. |
table.name | Required. The table in the destination database you want to sink to. |
type | Data format. Allowed formats:
|
primary_key | Required if type is upsert. The primary key of the downstream table. |
jdbc.url
must be accurate. The format varies slightly depending on if you are using AWS RDS MySQL or a self-hosted version of MySQL. If your MySQL is self-hosted, the jdbc.url
would have the following format: jdbc:mysql://127.0.0.1:3306/testdb?user=<username>&password=<password>
.
FLUSH
command to commit the update.
ARRAY['Value 1', 'Value 2']
when sinked to MySQL will be converted to the string Value 1, Value 2
.smallint
, integer
, bigint
, real
, double precision
, and varchar
type now.connectionTimeZone=UTC
in jdbc.url
to get the correct timestamptz
type data. For more details, see MySQL’s documentation.