Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing config docs for StarRocks #14823

Merged
merged 4 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
12 changes: 10 additions & 2 deletions src/connector/src/sink/starrocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
33 changes: 33 additions & 0 deletions src/connector/with_options_sink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading