# CREATE CONNECTOR

Create a new connector for fetching data from or writing data to an external system. A connector can be either a source or a sink one. Note that source connector is not supported yet.

# Synopsis

CREATE <SOURCE|SINK> CONNECTOR connector_name [IF NOT EXIST] WITH (connector_option [, ...]);
1

# Notes

  • connector_name is a valid identifier.
  • There is an optional IF NOT EXIST configuration to create a connector only if the connector with the same name does not exist.
  • There is are some connector options in the WITH clause separated by commas. TYPE and STREAM are required to specify the type of a connector and which stream it fetches data from/writes data to. For details, see the following table.
TYPEOptionDescriptionDefault Value
mysqlhostHost of MySQL server"127.0.0.1"
portPort of MySQL server3306
usernameUsername to login MySQL"root"
passwordPassword to login MySQL"password"
databaseDatabase name to store data from HStreamDB"mysql"
clickhousehostHost of ClickHouse server"127.0.0.1"
portPort of ClickHouse server9000
usernameUsername to login ClickHouse"default"
passwordPassword to login ClickHouse""
databaseDatabase name to store data from HStreamDB"default"

# Examples

CREATE SINK CONNECTOR mysql_conn WITH (TYPE = mysql, STREAM = foo, host = "127.0.0.1");
1