Skip to content

Commit

Permalink
Remove the legacy connector, Cache server and PG Wire Protocol (#639)
Browse files Browse the repository at this point in the history
* remove legacy connector and pg-wire related implementations

* modified the example and docker file

* fix the tests

* remove the sqlglot ci flow

* fix tests
  • Loading branch information
goldmedal authored Jun 28, 2024
1 parent f6eae2c commit f693af8
Show file tree
Hide file tree
Showing 371 changed files with 474 additions and 41,692 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ jobs:
- name: build
run: |
./mvnw clean install -B -DskipTests
- name: Prepare python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
- run: pip install -r wren-sqlglot-server/requirements.txt
- name: integration tests
env:
TEST_BIG_QUERY_PROJECT_ID: ${{ secrets.TEST_BIG_QUERY_PROJECT_ID }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

*.iml
*.ipr
*.iws
Expand Down
6 changes: 0 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ ENV ENV_WREN_VERSION=${WREN_VERSION}
ENV WREN_JAR=wren-server-${ENV_WREN_VERSION}-executable.jar
COPY ${WREN_JAR} ./


COPY wren-sqlglot-server/ ./wren-sqlglot-server/
RUN apt-get install -y python3 python3-pip
RUN pip3 install -r ./wren-sqlglot-server/requirements.txt


COPY entrypoint.sh ./
RUN chmod +x ./entrypoint.sh

Expand Down
1 change: 0 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
export ENV_MAX_HEAP_SIZE=$2
export ENV_MIN_HEAP_SIZE=$3
python3 wren-sqlglot-server/main.py &

# Required add-opens=java.nio=ALL-UNNAMED for Apache arrow in the Snowflake
java -Xmx${ENV_MAX_HEAP_SIZE:-"512m"} -Xms${ENV_MIN_HEAP_SIZE:-"64m"} -Dconfig=etc/config.properties \
Expand Down
1 change: 0 additions & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

This is some example Docker Compose project for different data source types. Please go to the respective directory for more information.

- [BigQuery Example](bigquery-example/README.md)
- [DuckDB TPCH Example](duckdb-tpch-example/README.md)
1 change: 0 additions & 1 deletion example/bigquery-example/.env

This file was deleted.

23 changes: 0 additions & 23 deletions example/bigquery-example/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions example/bigquery-example/docker-compose.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions example/bigquery-example/etc/accounts

This file was deleted.

27 changes: 0 additions & 27 deletions example/bigquery-example/etc/config.properties

This file was deleted.

5 changes: 0 additions & 5 deletions example/bigquery-example/etc/mdl/sample.json

This file was deleted.

57 changes: 48 additions & 9 deletions example/duckdb-tpch-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,55 @@ You can learn how to set up the Wren Engine with DuckDB data source to analyze y
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'
```
8. 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.
```json
{
"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"
}
```
3 changes: 0 additions & 3 deletions example/duckdb-tpch-example/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ services:
platform: ${PLATFORM}
ports:
- 8080:8080
- 7432:7432
volumes:
- ./etc:/usr/src/app/etc
- ./data:/usr/src/app/data
environment:
- SQLGLOT_PORT=8000
2 changes: 0 additions & 2 deletions example/duckdb-tpch-example/etc/accounts

This file was deleted.

2 changes: 0 additions & 2 deletions example/duckdb-tpch-example/etc/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
#
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/duckdb-session.sql
pg-wire-protocol.enabled=true
Loading

0 comments on commit f693af8

Please sign in to comment.