-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DuckDB Example to load data for docker compose (#500)
- Loading branch information
Showing
20 changed files
with
451 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
# Description | ||
|
||
This is an example Docker Compose project for running the Wren Engine. | ||
This is some example Docker Compose project for different data source types. Please go to the respective directory for more information. | ||
|
||
# How to use | ||
|
||
1. Set up the platform in `.env` file. (`linux/amd64`, `linux/arm64`) | ||
2. Configure settings in the `etc/config.properties` file. | ||
3. Place your MDL in `etc/mdl` file after removing the sample MDL file `etc/mdl/sample.json`. | ||
- The `mdl` directory should contain only one json file. | ||
4. Set up the accounts if you needs or remove the sample accounts if you don't need. | ||
- Sample accounts are provided in the `etc/accounts` directory. | ||
5. Run the docker-compose | ||
```bash | ||
docker compose --env-file .env up | ||
``` | ||
6. Connect using psql or another PostgreSQL driver using port 7432. | ||
- Sample usernames and passwords are `ina` and `wah`, or `azki` and `guess`. | ||
- The default database name should match the catalog of the MDL file. | ||
- The default schema name should match the schema of the MDL file. | ||
```bash | ||
psql 'host=localhost user=ina dbname=test_catalog port=7432 options=--search_path=test_schema' | ||
``` | ||
- [BigQuery Example](bigquery-example/README.md) | ||
- [DuckDB TPCH Example](duckdb-tpch-example/README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PLATFORM=linux/amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Description | ||
|
||
This is an example Docker Compose project for running the Wren Engine. | ||
|
||
# How to use | ||
|
||
1. Set up the platform in `.env` file. (`linux/amd64`, `linux/arm64`) | ||
2. Configure settings in the `etc/config.properties` file. | ||
3. Place your MDL in `etc/mdl` file after removing the sample MDL file `etc/mdl/sample.json`. | ||
- The `mdl` directory should contain only one json file. | ||
4. Set up the accounts if you needs or remove the sample accounts if you don't need. | ||
- Sample accounts are provided in the `etc/accounts` directory. | ||
5. Run the docker-compose in this directory. | ||
```bash | ||
docker compose --env-file .env up | ||
``` | ||
6. Connect using psql or another PostgreSQL driver using port 7432. | ||
- Sample usernames and passwords are `ina` and `wah`, or `azki` and `guess`. | ||
- The default database name should match the catalog of the MDL file. | ||
- The default schema name should match the schema of the MDL file. | ||
```bash | ||
psql 'host=localhost user=ina dbname=test_catalog port=7432 options=--search_path=test_schema' | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
PLATFORM=linux/amd64 | ||
ETC_PATH=./etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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 | ||
|
||
1. Set up the platform in `.env` file. (`linux/amd64`, `linux/arm64`) | ||
2. Configure settings in the `etc/config.properties` file. | ||
3. Place your data in `etc/data` file after removing the sample data files. | ||
4. Set up your initial SQL and session SQL in `etc/duckdb-init.sql` and `etc/duckdb-session.sql` files. | ||
5. Place your MDL in `etc/mdl` file after removing the sample MDL file `etc/mdl/sample.json`. | ||
- The `mdl` directory should contain only one json file. | ||
6. Set up the accounts if you needs or remove the sample accounts if you don't need. | ||
- Sample accounts are provided in the `etc/accounts` directory. | ||
7. Run the docker-compose in this directory. | ||
```bash | ||
docker compose --env-file .env up | ||
``` | ||
8. Connect using psql or another PostgreSQL driver using port 7432. | ||
- Sample usernames and passwords are `ina` and `wah`, or `azki` and `guess`. | ||
- The default database name should match the catalog of the MDL file. | ||
- The default schema name should match the schema of the MDL file. | ||
```bash | ||
psql 'host=localhost user=ina dbname=wren port=7432 options=--search_path=tpch' | ||
``` |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: '3.8' | ||
|
||
services: | ||
engine: | ||
image: ghcr.io/canner/wren-engine:latest | ||
platform: ${PLATFORM} | ||
ports: | ||
- 8080:8080 | ||
- 7432:7432 | ||
volumes: | ||
- ./etc:/usr/src/app/etc | ||
- ./data:/usr/src/app/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ina wah | ||
azki guess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# /* | ||
# * Licensed under the Apache License, Version 2.0 (the "License"); | ||
# * you may not use this file except in compliance with the License. | ||
# * You may obtain a copy of the License at | ||
# * | ||
# * http://www.apache.org/licenses/LICENSE-2.0 | ||
# * | ||
# * Unless required by applicable law or agreed to in writing, software | ||
# * distributed under the License is distributed on an "AS IS" BASIS, | ||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# * See the License for the specific language governing permissions and | ||
# * limitations under the License. | ||
# */ | ||
# | ||
node.environment=production | ||
wren.directory=/usr/src/app/etc/mdl | ||
pg-wire-protocol.auth.file=/usr/src/app/etc/accounts | ||
wren.experimental-enable-dynamic-fields=false | ||
wren.datasource.type=duckdb | ||
duckdb.connector.init-sql-path=/usr/src/app/etc/duckdb-init.sql | ||
duckdb.connector.session-sql-path=/usr/src/app/etc/mdl/duckdb-session.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE SCHEMA tpch; | ||
CREATE TABLE tpch.customer AS SELECT * FROM read_parquet('/usr/src/app/data/customer.parquet'); | ||
CREATE TABLE tpch.lineitem AS SELECT * FROM read_parquet('/usr/src/app/data/lineitem.parquet'); | ||
CREATE TABLE tpch.nation AS SELECT * FROM read_parquet('/usr/src/app/data/nation.parquet'); | ||
CREATE TABLE tpch.orders AS SELECT * FROM read_parquet('/usr/src/app/data/orders.parquet'); | ||
CREATE TABLE tpch.part AS SELECT * FROM read_parquet('/usr/src/app/data/part.parquet'); |
Empty file.
Oops, something went wrong.