Using Trino
The dbGaP GECCO Example
In the provision data section, we’ve shown a quick start recipe with the data-connect-trino docker container connected to a Trino instance hosted at https://trino-public.prod.dnastack.com
. This section provides more information on how this was accomplished.
Prerequisites
The following is required before we start.
- Java 11+
- A Trino server you can access anonymously over HTTP(S).
- Git
If you don’t have a Trino server to work against and you wish to try the app, try using
https://trino-public.prod.dnastack.com
as the data source.
1. Building the Trino Adapter App
Clone the repository
git clone https://github.com/DNAstack/data-connect-trino.git
Build the app
./mvnw clean package
2. Configuration
For a minimal configuration, we need a local PostgreSQL database where the app stores its bookkeeping information. By default, the app looks for a local PostgreSQL instance at localhost:5432 with username, password, and database name dataconnecttrino
. You can spin up such a database with this docker command:
docker run -d -p 5432:5432 --name data-connect-app-db -e POSTGRES_USER=dataconnecttrino -e POSTGRES_PASSWORD=dataconnecttrino postgres
Now you only need to provide two parameters: PRESTO_DATASOURCE_URL
and SPRING_PROFILES_ACTIVE
.
PRESTO_DATASOURCE_URL
points to the Trino server you wish to expose with a Data Connect API.
SPRING_PROFILES_ACTIVE
is used to disable OAuth authentication, which simplifies first-time setup.
export PRESTO_DATASOURCE_URL=https://<your-presto-server>
export SPRING_PROFILES_ACTIVE=no-auth
3. Run the adapter App
./mvnw clean spring-boot:run
Your application should now be accessible at http://localhost:8089/tables
To test the app out, follow the consuming data section.
Further Configuration
Further configuration can be found at: data-connect-trino.