Initialize
Running with Docker
-
Create a new directory and enter into the folder
mkdir ~/wren-engine
cd ~/wren-engine -
Make a file named
docker-compose.yml
then put below content into the file.version: '3.8'
services:
engine:
image: ghcr.io/canner/wren-engine:latest
platform: linux/amd64 # follow up your platform. (linux/amd64 or linux/arm64)(M1, M2, M3 is arm64)
ports:
- 8080:8080
- 7432:7432
volumes:
- ./etc:/usr/src/app/etc
environment:
- SQLGLOT_PORT=8000 -
Create a folder
etc
and enter the folder.mkdir etc
cd etc -
Create
config.properties
put intoetc
node.environment=production
wren.directory=/usr/src/app/etc/mdl
pg-wire-protocol.auth.file=/usr/src/app/etc/accounts
wren.datasource.type=duckdbWe support many data source type, you can check out the Overview to get the idea.
-
Create a file
accounts
put it intoetc
toohoward pxd123
-
Create a folder
mdl
and a filemdl.json
and store the file in the folder, the path looks asetc/mdl/mdl.json
{
"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"
}
],
"primaryKey": "orderkey"
}
]
}More about Modeling Definition Language
Running with JAR
- Requirements:
- Java 21+
-
Download the jar from the GitHub release(TBD: URL) and rename it to
wren-server-executable.jar
-
Create a new directory and move the Wren Engine JAR into it
mkdir ~/wren-engine
then
mv ~/Downloads/wren-server-executable.jar ~/wren-engine
-
Go to the folder Wren Engine directory and prepare config files
cd ~/wren-engine
-
Create a folder
etc
and enter it.mkdir etc
cd etc -
Create
config.properties
node.environment=production
wren.directory=/usr/src/app/etc/mdl
pg-wire-protocol.auth.file=/usr/src/app/etc/accounts
wren.datasource.type=duckdbWe support many data source type, you can check out the Overview to get the idea.
-
Create a file
accounts
howard pxd123
-
Create a folder
mdl
and a filemdl.json
, and put it in themdl
folder, path asetc/mdl/mdl.json
{
"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"
}
],
"primaryKey": "orderkey"
}
]
}More about Modeling Definition Language