Skip to content

Instantly share code, notes, and snippets.

@KoopaKing
Last active July 26, 2022 11:35
Show Gist options
  • Save KoopaKing/8e653e0c8d095323904946045c5fa4c2 to your computer and use it in GitHub Desktop.
Save KoopaKing/8e653e0c8d095323904946045c5fa4c2 to your computer and use it in GitHub Desktop.
An example presto postgresql connector for Dataproc
#!/bin/bash
set -euxo pipefail
YOUR_CATALOG_NAME="YOUR_CATALOG_NAME"
YOUR_POSTGRESQL_ENDPOINT="YOUR_HOST:5432"
YOUR_POSTGRESQL_DB="YOUR_DB"
YOUR_POSTGRESQL_USER_NAME="YOUR_USER"
YOUR_POSTGRESQL_PASSWORD="YOUR_PASSWORD"
cat >"/opt/presto-server/etc/catalog/${YOUR_CATALOG_NAME}.properties" <<EOF
connector.name=postgresql
connection-url=jdbc:postgresql://${YOUR_POSTGRESQL_ENDPOINT}/${YOUR_POSTGRESQL_DB}
connection-user=${YOUR_POSTGRESQL_USER_NAME}
connection-password=${YOUR_POSTGRESQL_PASSWORD}
EOF
systemctl restart presto
systemctl status presto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment