diff --git a/README.md b/README.md index 753e1d598c60..e1cd266da555 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,7 @@ RisingWave is fundamentally a database that **extends beyond basic streaming dat Within your data stack, RisingWave can assist with: * Processing and transforming event streaming data in real time -* Offloading event-driven queries (e.g., materialized views, triggers) from operational databases +* Offloading event-driven queries (e.g., materialized views, triggers) from operational databases * Performing real-time ETL (Extract, Transform, Load) RisingWave is extensively utilized in real-time applications such as monitoring, alerting, dashboard reporting, ML feature engineering, among others. It has already been adopted in fields such as financial trading, manufacturing, new media, logistics, gaming, and more. Check out [customer stories](https://www.risingwave.com/use-cases/). diff --git a/src/connector/src/sink/starrocks.rs b/src/connector/src/sink/starrocks.rs index 34286a3b6e99..d1c1f97f6a60 100644 --- a/src/connector/src/sink/starrocks.rs +++ b/src/connector/src/sink/starrocks.rs @@ -29,6 +29,7 @@ use serde::Deserialize; use serde_derive::Serialize; use serde_json::Value; use serde_with::serde_as; +use with_options::WithOptions; use super::doris_starrocks_connector::{ HeaderBuilder, InserterInner, InserterInnerBuilder, DORIS_SUCCESS_STATUS, STARROCKS_DELETE_SIGN, @@ -44,26 +45,33 @@ const STARROCK_MYSQL_PREFER_SOCKET: &str = "false"; const STARROCK_MYSQL_MAX_ALLOWED_PACKET: usize = 1024; const STARROCK_MYSQL_WAIT_TIMEOUT: usize = 28800; -#[derive(Deserialize, Debug, Clone)] +#[derive(Deserialize, Debug, Clone, WithOptions)] pub struct StarrocksCommon { + /// The StarRocks host address. #[serde(rename = "starrocks.host")] pub host: String, + /// The port to the MySQL server of StarRocks FE. #[serde(rename = "starrocks.mysqlport")] pub mysql_port: String, + /// The port to the HTTP server of StarRocks FE. #[serde(rename = "starrocks.httpport")] pub http_port: String, + /// The user name used to access the StarRocks database. #[serde(rename = "starrocks.user")] pub user: String, + /// The password associated with the user. #[serde(rename = "starrocks.password")] pub password: String, + /// The StarRocks database where the target table is located #[serde(rename = "starrocks.database")] pub database: String, + /// The StarRocks table you want to sink data to. #[serde(rename = "starrocks.table")] pub table: String, } #[serde_as] -#[derive(Clone, Debug, Deserialize)] +#[derive(Clone, Debug, Deserialize, WithOptions)] pub struct StarrocksConfig { #[serde(flatten)] pub common: StarrocksCommon, diff --git a/src/connector/with_options_sink.yaml b/src/connector/with_options_sink.yaml index b74ccb9814e5..15f9d40f6780 100644 --- a/src/connector/with_options_sink.yaml +++ b/src/connector/with_options_sink.yaml @@ -452,3 +452,36 @@ RedisConfig: - name: redis.url field_type: String required: true +StarrocksConfig: + fields: + - name: starrocks.host + field_type: String + comments: The StarRocks host address. + required: true + - name: starrocks.mysqlport + field_type: String + comments: The port to the MySQL server of StarRocks FE. + required: true + - name: starrocks.httpport + field_type: String + comments: The port to the HTTP server of StarRocks FE. + required: true + - name: starrocks.user + field_type: String + comments: The user name used to access the StarRocks database. + required: true + - name: starrocks.password + field_type: String + comments: The password associated with the user. + required: true + - name: starrocks.database + field_type: String + comments: The StarRocks database where the target table is located + required: true + - name: starrocks.table + field_type: String + comments: The StarRocks table you want to sink data to. + required: true + - name: r#type + field_type: String + required: true