Connect to a CDP Data Hub cluster

The Data Connection Snippet feature helps simplify the user experience by abstracting the complexity of creating and configuring a data connection.

You can set up a Data Hub Impala or Hive connection by following the documentation: Set up a data connection to CDP Data Hub.

However, if you would still like to use raw Python code to connect, follow this Python example:

from impala.dbapi import connect
#Example connection string:
# jdbc:hive2://;ssl=true;transportMode=http;httpPath=my-test/cdp-proxy-api/hive


conn = connect(
    host = "",
    port = 443,
    auth_mechanism = "LDAP",
    use_ssl = True,
    use_http_transport = True,
    http_path = "my-test/cdp-proxy-api/hive",
    user = USERNAME,
    password = PASSWORD)
cursor = conn.cursor()
cursor.execute("<<INSERT SQL QUERY HERE>>")

for row in cursor: