Skip to content

Commit 90b1fad

Browse files
committed
optimize doc
Signed-off-by: jaogoy <jaogoy@gmail.com>
1 parent ce503f6 commit 90b1fad

File tree

2 files changed

+48
-11
lines changed

2 files changed

+48
-11
lines changed

docs/integrations/engines/starrocks.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,55 @@
66

77
SQLMesh supports StarRocks through its MySQL-compatible protocol, providing StarRocks-specific optimizations for table models, indexing, partitioning, and more. The adapter leverages StarRocks's strengths for analytical workloads with sensible defaults and advanced configuration support.
88

9+
## Prerequisites
10+
11+
* Install SQLMesh with the StarRocks extra:
12+
13+
```bash
14+
pip install "sqlmesh[starrocks]"
15+
```
16+
17+
* Initialize a SQLMesh project (if you haven't already):
18+
19+
```bash
20+
sqlmesh init
21+
```
22+
23+
* Configure a separate state backend:
24+
* StarRocks is currently **not supported** as a SQLMesh `state_connection`.
25+
* Use DuckDB (recommended) or another engine for SQLMesh state.
26+
927
## Connection Configuration Example
1028

11-
```yaml
12-
starrocks:
13-
connection:
14-
type: starrocks
15-
host: starrocks-fe # Frontend (FE) node address
16-
port: 9030 # Query port (default: 9030)
17-
user: starrocks_user
18-
password: your_password
19-
database: your_database
20-
# Optional MySQL-compatible settings
29+
```yaml linenums="1" hl_lines="2 4-8 13-15"
30+
gateways:
31+
starrocks:
32+
connection:
33+
type: starrocks
34+
host: starrocks-fe # Frontend (FE) node address
35+
port: 9030 # Query port (default: 9030)
36+
user: starrocks_user
37+
password: your_password
38+
database: your_database
39+
# Optional MySQL-compatible settings
40+
# charset: utf8mb4
41+
# connect_timeout: 60
42+
state_connection:
43+
type: duckdb
44+
database: ./state/sqlmesh_state.db
45+
46+
default_gateway: starrocks
47+
48+
model_defaults:
49+
dialect: starrocks
50+
```
51+
52+
### StarRocks setup note (optional)
53+
54+
If you're running a shared-nothing cluster with a single backend, you may need to adjust the default replication number:
55+
56+
```sql
57+
ADMIN SET frontend config ("default_replication_num" = "1");
2158
```
2259

2360
## Quickstart

sqlmesh/core/config/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ class StarRocksConnectionConfig(ConnectionConfig):
23652365
type_: t.Literal["starrocks"] = Field(alias="type", default="starrocks")
23662366
DIALECT: t.ClassVar[t.Literal["starrocks"]] = "starrocks"
23672367
DISPLAY_NAME: t.ClassVar[t.Literal["StarRocks"]] = "StarRocks"
2368-
DISPLAY_ORDER: t.ClassVar[t.Literal[19]] = 19
2368+
DISPLAY_ORDER: t.ClassVar[t.Literal[18]] = 18
23692369

23702370
_engine_import_validator = _get_engine_import_validator("pymysql", "starrocks")
23712371

0 commit comments

Comments
 (0)