# ClickHouse
For context on getting started with ingestion, check out our [metadata ingestion guide](../README.md).
## Setup
To install this plugin, run `pip install 'acryl-datahub[clickhouse]'`.
## Capabilities
This plugin extracts the following:
- Metadata for tables, views, materialized views and dictionaries
- Column types associated with each table(except *AggregateFunction and DateTime with timezone)
- Table, row, and column statistics via optional [SQL profiling](./sql_profiles.md)
- Table, view, materialized view and dictionary(with CLICKHOUSE source_type) lineage
:::tip
You can also get fine-grained usage statistics for ClickHouse using the `clickhouse-usage` source described below.
:::
## Quickstart recipe
Check out the following recipe to get started with ingestion! See [below](#config-details) for full configuration options.
For general pointers on writing and running a recipe, see our [main recipe guide](../README.md#recipes).
```yml
source:
type: clickhouse
config:
# Coordinates
host_port: localhost:9000
# Credentials
username: user
password: pass
# Options
platform_instance: DatabaseNameToBeIngested
include_views: True # whether to include views, defaults to True
include_tables: True # whether to include views, defaults to True
sink:
# sink configs
```
Extra options to use encryption connection or different interface
For the HTTP interface:
```yml
source:
type: clickhouse
config:
host_port: localhost:8443
protocol: https
```
For the Native interface:
```yml
source:
type: clickhouse
config:
host_port: localhost:9440
scheme: clickhouse+native
secure: True
```
## Config details
Like all SQL-based sources, the ClickHouse integration supports:
- Stale Metadata Deletion: See [here](./stateful_ingestion.md) for more details on configuration.
- SQL Profiling: See [here](./sql_profiles.md) for more details on configuration.
Note that a `.` is used to denote nested fields in the YAML recipe.
| Field | Required | Default | Description |
|-----------------------------|----------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `username` | | | ClickHouse username. |
| `password` | | | ClickHouse password. |
| `host_port` | ✅ | | ClickHouse host URL. |
| `database` | | | ClickHouse database to connect. |
| `env` | | `"PROD"` | Environment to use in namespace when constructing URNs. |
| `platform_instance` | | None | The Platform instance to use while constructing URNs. |
| `options.