via Python Library

Hydrolix uses the Clickhouse SQL engine, so you can connect to Hydrolix using any of several different Python libraries that support Clickhouse servers. This example uses clickhouse-driver.

To install clickhouse-driver, run the following command:

pip3 install clickhouse-driver

Use the following code snippet to import the client, connect to a Hydrolix instance, and execute a query:

from clickhouse_driver import Client
client = Client.from_url('clickhouse://<TODO: replace this with your hostname>:9440/sample?secure=True')
client.execute('SELECT COUNT() FROM sample.performance_logs')

Don't forget to replace the hostname with your own Hydrolix cluster's hostname!