Skip to content

Commit 0b5eaea

Browse files
brucearctorxinge.ji
andcommitted
Feat: Add Apache Doris engine adapter with OLAP and Iceberg multi-catalog support
Closes #5875 Co-authored-by: xinge.ji <xinge.ji@outlook.com> Signed-off-by: Bruce Arctor <5032356+brucearctor@users.noreply.github.com>
1 parent c0026dc commit 0b5eaea

24 files changed

Lines changed: 4290 additions & 20 deletions

‎.github/scripts/install-prerequisites.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ elif [ "$ENGINE" == "fabric" ]; then
2828
rm packages-microsoft-prod.deb
2929

3030
ENGINE_DEPENDENCIES="msodbcsql18"
31+
elif [ "$ENGINE" == "doris" ]; then
32+
ENGINE_DEPENDENCIES="mysql-client"
33+
sudo sysctl -w vm.max_map_count=2000000
34+
sudo swapoff -a || true
3135
fi
3236

3337
ALL_DEPENDENCIES="$COMMON_DEPENDENCIES $ENGINE_DEPENDENCIES"

‎.github/scripts/wait-for-db.sh‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,34 @@ db2_ready() {
104104
done
105105
}
106106

107+
doris_ready() {
108+
probe_port 9030 || return 1
109+
HOSTNAME=${DOCKER_HOSTNAME:-127.0.0.1}
110+
if [ "$HOSTNAME" = "localhost" ]; then
111+
HOSTNAME="127.0.0.1"
112+
fi
113+
INIT_SQL="ADMIN SET FRONTEND CONFIG ('default_replication_num' = '1'); ADMIN SET FRONTEND CONFIG ('force_olap_table_replication_num' = '1'); ADMIN SET FRONTEND CONFIG ('enable_unicode_name_support' = 'true');"
114+
if command -v mysql > /dev/null 2>&1; then
115+
mysql -h "$HOSTNAME" -P 9030 -u root -e "SHOW BACKENDS\G" 2>/dev/null | grep -q "Alive: true" && \
116+
mysql -h "$HOSTNAME" -P 9030 -u root -e "$INIT_SQL" 2>/dev/null
117+
else
118+
python3 -c "
119+
import pymysql, sys
120+
conn = pymysql.connect(host='$HOSTNAME', port=9030, user='root', autocommit=True)
121+
with conn.cursor() as cur:
122+
cur.execute('SHOW BACKENDS')
123+
rows = cur.fetchall()
124+
cols = [d[0] for d in cur.description]
125+
alive_idx = cols.index('Alive')
126+
if not rows or not any(str(r[alive_idx]).lower() == 'true' for r in rows):
127+
sys.exit(1)
128+
for cfg in ('default_replication_num', 'force_olap_table_replication_num'):
129+
cur.execute(f\"ADMIN SET FRONTEND CONFIG ('{cfg}' = '1')\")
130+
cur.execute(\"ADMIN SET FRONTEND CONFIG ('enable_unicode_name_support' = 'true')\")
131+
" 2>/dev/null
132+
fi
133+
}
134+
107135
echo "Waiting for $ENGINE to be ready..."
108136

109137
READINESS_FUNC="${ENGINE}_ready"

‎.github/workflows/pr.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ jobs:
269269
clickhouse,
270270
risingwave,
271271
starrocks,
272+
doris,
272273
]
273274
env:
274275
PYTEST_XDIST_AUTO_NUM_WORKERS: 2

‎.readthedocs.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build:
66
python: "3.10"
77
jobs:
88
pre_build:
9-
- pip install -e ".[athena,azuresql,bigframes,bigquery,clickhouse,databricks,dbt,dlt,gcppostgres,github,llm,mssql,mysql,mwaa,postgres,redshift,slack,snowflake,starrocks,trino,web,risingwave]"
9+
- pip install -e ".[athena,azuresql,bigframes,bigquery,clickhouse,databricks,dbt,dlt,doris,gcppostgres,github,llm,mssql,mysql,mwaa,postgres,redshift,slack,snowflake,starrocks,trino,web,risingwave]"
1010
- make api-docs
1111

1212
mkdocs:

‎Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ starrocks-test: engine-starrocks-up
226226
db2-test: engine-db2-up
227227
pytest -n auto -m "db2" --reruns 3 --junitxml=test-results/junit-db2.xml
228228

229+
doris-test: engine-doris-up
230+
pytest -n auto -m "doris" --reruns 3 --junitxml=test-results/junit-doris.xml
231+
229232
#################
230233
# Cloud Engines #
231234
#################

‎docs/guides/configuration.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,7 @@ These pages describe the connection configuration options for each execution eng
933933
* [BigQuery](../integrations/engines/bigquery.md)
934934
* [ClickHouse](../integrations/engines/clickhouse.md)
935935
* [Databricks](../integrations/engines/databricks.md)
936+
* [Doris](../integrations/engines/doris.md)
936937
* [DuckDB](../integrations/engines/duckdb.md)
937938
* [Fabric](../integrations/engines/fabric.md)
938939
* [MotherDuck](../integrations/engines/motherduck.md)
@@ -978,6 +979,7 @@ Unsupported state engines, even for development:
978979
* [Spark](../integrations/engines/spark.md)
979980
* [StarRocks](../integrations/engines/starrocks.md)
980981
* [Trino](../integrations/engines/trino.md)
982+
* [Doris](../integrations/engines/doris.md)
981983

982984
This example gateway configuration uses Snowflake for the data warehouse connection and Postgres for the state backend connection:
983985

‎docs/guides/connections.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ default_gateway: local_db
8585
* [ClickHouse](../integrations/engines/clickhouse.md)
8686
* [Databricks](../integrations/engines/databricks.md)
8787
* [Db2](../integrations/engines/db2.md)
88+
* [Doris](../integrations/engines/doris.md)
8889
* [DuckDB](../integrations/engines/duckdb.md)
8990
* [Fabric](../integrations/engines/fabric.md)
9091
* [MotherDuck](../integrations/engines/motherduck.md)

‎docs/installation.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Other extras are required to use specific SQL engines, like Bigquery or Postgres
5454
| Bigquery | `pip install "sqlmesh[bigquery]"` |
5555
| ClickHouse | `pip install "sqlmesh[clickhouse]"` |
5656
| Databricks | `pip install "sqlmesh[databricks]"` |
57+
| Doris | `pip install "sqlmesh[doris]"` |
5758
| Fabric | `pip install "sqlmesh[fabric]"` |
5859
| GCP Postgres | `pip install "sqlmesh[gcppostgres]"` |
5960
| MS SQL Server | `pip install "sqlmesh[mssql]"` |

0 commit comments

Comments
 (0)