mirror of
https://github.com/Canner/WrenAI.git
synced 2026-09-01 04:57:29 +08:00
Description
This is an example Docker Compose project for DuckDB data source with some tpch data. You can learn how to set up the Wren Engine with DuckDB data source to analyze your data.
How to use
- Set up the platform in
.envfile. (linux/amd64,linux/arm64) - Configure settings in the
etc/config.propertiesfile. - Place your data in
etc/datafile after removing the sample data files. - Set up your initial SQL and session SQL in
etc/duckdb-init.sqlandetc/duckdb-session.sqlfiles. - Place your MDL in
etc/mdlfile after removing the sample MDL fileetc/mdl/sample.json.- The
mdldirectory should contain only one json file.
- The
- Run the docker-compose in this directory.
docker compose --env-file .env up - Call the Wren Engine API to analyze your data with the request body as below.
- URL
GET http://localhost:8080/v1/mdl/preview - Body: The manifest is the content of the MDL file.
{ "manifest": { "catalog": "wren", "schema": "tpch", "models": [ { "name": "Orders", "tableReference": { "catalog": "memory", "schema": "tpch", "table": "orders" }, "columns": [ { "name": "orderkey", "expression": "o_orderkey", "type": "integer" }, { "name": "custkey", "expression": "o_custkey", "type": "integer" }, { "name": "orderstatus", "expression": "o_orderstatus", "type": "varchar" }, { "name": "totalprice", "expression": "o_totalprice", "type": "float" } ], "primaryKey": "orderkey" } ] }, "sql": "select * from Orders" }
- URL