Last active
          July 26, 2022 11:35 
        
      - 
      
 - 
        
Save KoopaKing/8e653e0c8d095323904946045c5fa4c2 to your computer and use it in GitHub Desktop.  
    An example presto postgresql connector for Dataproc
  
        
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/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