Skip to content

Commit

Permalink
trino: Allow installing UDFs at arbitrary URL
Browse files Browse the repository at this point in the history
This is needed for when we're invoked from a different container than
the one with our server.
  • Loading branch information
emk committed Feb 29, 2024
1 parent 7be8496 commit 38655a6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docker/trino/install-udfs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
#
# Install UDFs into Trino.
#
# Usage: install-udfs [trino_url]

set -euo pipefail

until curl -s http://localhost:8080/v1/info | grep -q '"starting":false'; do sleep 1; done
trino --file "/etc/trino/trino_compat.sql"
# URL of our Trino server.
trino_url="${1:-"http://localhost:8080"}"

until curl -s "$trino_url/v1/info" | grep -q '"starting":false'; do sleep 1; done
trino --file "/etc/trino/trino_compat.sql" "$trino_url"

0 comments on commit 38655a6

Please sign in to comment.