Skip to content

ClickHouse Considerations

The Hydrolix query language is an ANSI-compliant SQL, based on the ClickHouse SQL language. Queries are passed through the Hydrolix Query API which offers programmatic access to your data.

To query data,

  1. Ingest some data
  2. Construct the WHERE clause
  3. Define the query conditions
  4. Execute the query against the Query API

Build a SQL Query⚓︎

When querying Hydrolix, follow these steps:

  1. Specify the project name and the table name within the FROM portion of the SELECT statement separated by a period (.).

    1
    2
    3
    SELECT ……
      FROM project_name.table_name
      WHERE ……
    
  2. (optional) Specify a view schema

    Hydrolix allows multiple, different read schema for the same table. The read schema is known as a custom view and limits the client's access to a subset of columns.

    The view schema is optional in SQL queries. Queries default to using the automatic view schema which includes every column in the data set.

  3. A where clause

    When referencing data in tables, a time specification within a WHERE predicate is required. This predicate should reference the primary datetime column that was specified in the transform schema when the data was ingested.

    1
    2
    3
    SELECT count(timestamp) AS count
      FROM my_first_project.the_table
      WHERE (timestamp BETWEEN '1977-04-25 00:00:00' AND  '2010-04-25 23:00:00')
    
  4. Define the rest of the query.

    Refer to the Hydrolix tutorials and SQL Reference to understand query syntax and see running examples.

  5. Execute the query

    Queries are sent to Hydrolix through the Query API. The only required parameter is "query" to pass in the query. Query results are returned as JSON.