Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 33 additions & 0 deletions infra/local/trino-execute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
# shellcheck disable=1091
# Execute scripts through Trino, connecting to the catalogs defined in the docker-compose.yml
# configuration. Authentication is enabled so connections require ssl and simply running
# 'docker compose exec trino' won't work. Instead connections go through Traefik that terminates
# the TLS connection.

if [ $# -ne 2 ]; then
echo "Usage: $0 <catalog_name> <args_for_execute>"
exit 1
fi

# single catalog argument
catalog=$1
shift

# local environment
source "$(dirname "$0")/env-local"

docker run \
--rm \
--interactive \
--tty \
--network host \
--env TRINO_PASSWORD="$TRINO_PASSWORD" \
trinodb/trino:477 \
trino \
--user "$TRINO_USER" \
--password \
--server https://adp-router:58443 \
--insecure \
--catalog "$catalog" \
--execute "$*"
2 changes: 2 additions & 0 deletions warehouses/facility_ops/transform/dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ models:
+schema: staging_accelerator
beamlines:
+schema: staging_beamlines
estates:
+schema: staging_estates
marts:
+materialized: table
accelerator:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

sources:
- name: accelerator_electricity_sharepoint
- name: estates_electricity_sharepoint
database: facility_ops_landing
tables:
- name: rdm_data
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
with source as (

select * from {{ source('accelerator_electricity_sharepoint', 'rdm_data') }}
select * from {{ source('estates_electricity_sharepoint', 'rdm_data') }}

),

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[sources.electricity_sharepoint.rdm_data]
backfill = false
site_url = "https://stfc365.sharepoint.com/sites/ISISSustainability"
root_dir = "/General/RDM Data"
Loading