Code Samples
Python code snippets to carry out common operations on e6data
Best Practices
Environment Variables
HOST_NAME=os.getenv("HOST_NAME")
E6_USER=os.getenv("E6_USER")
E6_TOKEN = os.getenv("E6_TOKEN")from e6data_python_connector import ConnectionCreate Connection
from e6data_python_connector import Connection
username = '<username>' # Your e6data Email ID.
password = '<password>' # Access Token generated in the e6data console.
host = '<host>' # IP address or hostname of the cluster to be used.
database = '<database>' # # Database to perform the query on.
port = 443 # Port of the e6data engine.
catalog_name = '<catalog_name>'
cluster_uuid = '<cluster_uuid>' # Specify cluster UUID on when secure=True
secure = True # Flag to use a secure channel for data transfer, default to False
conn = Connection(
host=host,
port=port,
username=username,
database=database,
password=password,
cluster_uuid=cluster_uuid,
secure=secure
)Switch Database in an Existing Connection
Perform Query & Get Results
Code Hygiene
Get Row Count
Get Query Execution Plan
Abort a Query
Get Query Time Metrics
Get Query ID
Combine Multiple Functions
Last updated
