-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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
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,62 @@ | ||
### Docker Compose setup for Trino (x MongoDB) | ||
|
||
Пример настройки Trino локально с использованием MongoDB в качестве источника данных. | ||
|
||
#### 0. Prep | ||
|
||
```sh | ||
docker pull trinodb/trino | ||
docker pull mongo | ||
``` | ||
|
||
- https://trino.io/docs/current/installation/containers.html | ||
- https://hub.docker.com/r/trinodb/trino | ||
|
||
#### 1. Trino configuration | ||
|
||
- [Configuring Trino](https://trino.io/docs/current/installation/deployment.html#configuring-trino) | ||
- [Community tutorials | github](https://github.com/bitsondatadev/trino-getting-started/tree/main/community-tutorials) | ||
|
||
minimal setup: | ||
``` | ||
. | ||
├── docker-compose.yaml | ||
├── etc # trino configuration volume | ||
│ └── catalog | ||
│ └── mongo.properties # ext data source connection config | ||
│ └── jvm.config | ||
│ └── node.properties | ||
│ └── config.properties | ||
│ └── log.properties | ||
└── mongodb # ext data source data volume | ||
``` | ||
|
||
#### 2. Run & populate external data source | ||
|
||
``` | ||
docker compose up -d | ||
# find out container name with 'docker ps' | ||
docker exec -it trino-mongo-mongodb-1 mongosh | ||
mongosh > db.createCollection("orders"); | ||
mongosh > ... | ||
``` | ||
|
||
#### 3. Query external data source from Trino | ||
|
||
- [Trino CLI](https://docs.starburst.io/clients/cli.html#cli) | ||
|
||
``` | ||
docker exec -it trino-mongo-trino-1 trino | ||
trino > show catalogs; | ||
mongo | ||
trino > show schemas from mongo; | ||
test | ||
trino > show tables from mongo.test; | ||
orders | ||
trino > show columns from mongo.test.orders; | ||
... | ||
trino > select * from mongo.test.orders; | ||
... | ||
``` |