Adding database connectors - Amazon EMR

Adding database connectors

You can use configuration classifications to configure JDBC connector properties when you create a cluster. Configuration classifications begin with presto-connector, for example, presto-connector-postgresql. The available configuration classifications depend on the Amazon EMR release version. For the configuration classifications available with the most recent release version, see 5.36.1 configuration classifications for Amazon EMR 5.36.1. If you are using a different version of Amazon EMR, see Amazon EMR 5.x release versions for the configuration classifications. For more information about the properties that can be configured with each connector, see https://prestodb.io/docs/current/connector.html.

Example —configuring a cluster with the PostgreSQL JDBC connector

To launch a cluster with the PostgreSQL connector installed and configured, first create a JSON file that specifies the configuration classification—for example, myConfig.json—with the following content, and save it locally.

Replace the connection properties as appropriate for your setup and as shown in the PostgreSQL connector topic in Presto Documentation.

[ { "Classification": "presto-connector-postgresql", "Properties": { "connection-url": "jdbc:postgresql://example.net:5432/database", "connection-user": "MYUSER", "connection-password": "MYPASS" }, "Configurations": [] } ]

When you create the cluster, reference the path to the JSON file using the --configurations option as shown in the following example, where myConfig.json is in the same directory where you run the command:

aws emr create-cluster --name PrestoConnector --release-label emr-5.36.1 --instance-type m5.xlarge \ --instance-count 2 --applications Name=Hadoop Name=Hive Name=Pig Name=Presto \ --use-default-roles --ec2-attributes KeyName=myKey \ --log-uri s3://my-bucket/logs --enable-debugging \ --configurations file://myConfig.json