Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickhouse docs #211

Merged
merged 2 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions spiceaidocs/docs/data-connectors/clickhouse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: 'Clickhouse Data Connector'
sidebar_label: 'Clickhouse Data Connector'
description: 'Clickhouse Data Connector Documentation'
---

## Federated SQL query

To connect to any Clickhouse database as connector for federated SQL query, specify `clickhouse` as the selector in the `from` value for the dataset.

```yaml
datasets:
- from: clickhouse:path.to.my_dataset
name: my_dataset
```

## Configuration

The Clickhouse data connector can be configured by providing the following `params`:

- `clickhouse_connection_string`: The connection string to use to connect to the Clickhouse server. This can be used instead of providing individual connection parameters.
- `clickhouse_connection_string_key`: The secret key containing the connection string to use to connect to the Clickhouse server. This can be used instead of providing individual connection parameters.
digadeesh marked this conversation as resolved.
Show resolved Hide resolved
- `clickhouse_host`: The hostname of the Clickhouse server.
- `clickhouse_tcp_port`: The port of the Clickhouse server.
- `clickhouse_db`: The name of the database to connect to.
- `clickhouse_user`: The username to connect with.
- `clickhouse_pass_key`: The secret key containing the password to connect with.
- `clickhouse_pass`: The raw password to connect with, ignored if `clickhouse_pass_key` is provided.
- `clickhouse_secure`: Optional parameter, specifies the SSL/TLS behavior for the connection, supported values:
- `true`: (default) This mode requires an SSL connection. If a secure connection cannot be established, server will not connect.
- `false`: This mode will not attempt to use an SSL connection, even if the server supports it.
- `clickhouse_connection_timeout`: Optional parameter, specifies the connection timeout in milliseconds.

Configuration `params` are provided either in the top level `dataset` for a dataset source and federated SQL query.

```yaml
digadeesh marked this conversation as resolved.
Show resolved Hide resolved
datasets:
- from: clickhouse:path.to.my_dataset
name: my_dataset
params:
clickhouse_host: localhost
clickhouse_tcp_port: 9000
clickhouse_db: my_database
clickhouse_user: my_user
clickhouse_pass_key: my_secret
clickhouse_connection_timeout: 10000
clickhouse_secure: true
```

```yaml
datasets:
- from: clickhouse:path.to.my_dataset
name: my_dataset
params:
clickhouse_connection_string: tcp://my_user:mypassword@localhost:9000/my_database
clickhouse_connection_timeout: 10000
clickhouse_secure: true
```

```yaml
datasets:
- from: clickhouse:path.to.my_dataset
name: my_dataset
params:
clickhouse_connection_string: tcp://my_user:mypassword@localhost:9000/my_database?connection_timeout=10000&secure=true
```
3 changes: 2 additions & 1 deletion spiceaidocs/docs/data-connectors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ Currently supported Data Connectors include:
| `snowflake` | Snowflake | Coming soon! | Arrow Flight SQL | `full` | ❌ |
| `bigquery` | BigQuery | Coming soon! | Arrow Flight SQL | `full` | ❌ |
| `mysql` | MySQL | Alpha | | `full` | ❌ |
| `clickhouse` | Clickhouse | Alpha | | `full` | ❌ |

## Data Connector Docs

import DocCardList from '@theme/DocCardList';

<DocCardList />
<DocCardList />
3 changes: 2 additions & 1 deletion spiceaidocs/docs/reference/spicepod/datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Where:
- [`s3`](../../data-connectors/s3.md)
- [`postgres`](../../data-connectors/postgres/index.md)
- [`mysql`](../../data-connectors/mysql.md)
- [`clickhouse`](../../data-connectors/clickhouse.md)

If the Data Connector is not explicitly specified, it defaults to `spiceai`.

Expand All @@ -102,7 +103,7 @@ Required to enable a retention policy on the dataset.
Optional. The format of the `time_column`. The following values are supported:
- `unix_seconds` - Default. Unix timestamp in seconds.
- `unix_millis` - Unix timestamp in milliseconds.
- `ISO8601` - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
- `ISO8601` - [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.

:::warning[Current Limitations]
- any string-based column is assumed to be ISO8601 format.
Expand Down