Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trino container #1756

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add trino container.
  • Loading branch information
lloydtabb committed Jul 6, 2024
commit a91627282e3a621dfcbbaf2007094a4837547a6d
2 changes: 1 addition & 1 deletion packages/malloy-db-trino/src/trino_connection.ts
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ export class TrinoConnection implements Connection, PersistSQLResults {
// TODO: check user is set.
this.trino = Trino.create({
server: config.server,
catalog: 'malloy_demo', //config.catalog,
catalog: config.catalog,
schema: config.schema,
auth: new BasicAuth(config.user!, config.password),
});
34 changes: 34 additions & 0 deletions test/trino/trino_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/bash
rm -rf .tmp
mkdir .tmp

# generate config file
> ./.tmp/bigquery.properties
cat << EOF > ./.tmp/bigquery.properties
connector.name=bigquery
bigquery.project-id=advance-lacing-417917
bigquery.credentials-key=$BQ_CREDENTIALS_KEY
bigquery.arrow-serialization.enabled=false
EOF

# run docker
docker run -p 8090:8080 -d -v ./.tmp/bigquery.properties:/etc/trino/catalog/bigquery.properties --name trino-malloy trinodb/trino

# wait for server to start
counter=0
while ! docker logs trino-malloy 2>&1 | grep -q "SERVER STARTED"
do
sleep 1
counter=$((counter+1))
# if doesn't start after 2 minutes, output logs and kill process
if [ $counter -eq 120 ]
then
docker logs trino-malloy >& ./.tmp/trino-malloy.logs
docker rm -f trino-malloy
echo "Trino did not start successfully, check .tmp/trino-malloy.logs"
exit 1
break
fi
done

echo "Trino running on port localhost:8090"
7 changes: 7 additions & 0 deletions test/trino/trino_stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

# clear tmp files
rm -rf .tmp

# stop container
docker rm -f trino-malloy