ClickHouse¶
Driver Version v0.1.0-alpha.2 Tested With ClickHouse 25.12
This driver provides access to ClickHouse , an open source data warehouse and analytical database. It is developed by ClickHouse, Inc. The source code can be found at adbc_clickhouse ; the ADBC Driver Foundry distributes precompiled binaries of the upstream sources for Linux, macOS, and Windows.
ClickHouse is a trademark of ClickHouse, Inc. https://clickhouse.com
Installation¶
The ClickHouse driver can be installed with dbc :
dbc install --pre clickhouse
Note
Only prerelease versions of the driver are currently available, so you must use --pre with dbc 0.2.0 or newer to install the driver.
Connecting¶
To use the driver, provide the URI of a ClickHouse database as the uri option.
from adbc_driver_manager import dbapi
conn = dbapi.connect(
driver="clickhouse",
db_kwargs={
"uri": "http://localhost:8123/",
}
)
Note: The example above is for Python using the adbc-driver-manager package but the process will be similar for other driver managers.
Feature & Type Support¶
| Feature | ClickHouse | |
|---|---|---|
| Bulk Ingestion | Create | ❌ |
| Append | ❌ | |
| Create/Append | ❌ | |
| Replace | ❌ | |
| Temporary Table | ❌ | |
| Target Catalog | ❌ | |
| Target Schema | ❌ | |
| Non-nullable fields are marked NOT NULL | ❌ | |
| Catalog (GetObjects) | depth=catalogs | ❌ |
| depth=db_schemas | ❌ | |
| depth=tables | ❌ | |
| depth=columns (all) | ❌ | |
| Get Parameter Schema | ❌ | |
| Get Table Schema | ❌ | |
| Prepared Statements | ❌ | |
| Transactions | ❌ | |
Types¶
Database to Arrow¶
| Database Type | ClickHouse |
|---|---|
|
Boolean |
bool |
|
Date32 |
date32[day] [1] |
|
DateTime64 (no time zone) |
|
|
DateTime64 (with time zone) |
timestamp[us] (with time zone) [3] |
|
Decimal |
decimal128 |
|
Float32 |
float |
|
Float64 |
double |
|
Int16 |
int16 |
|
Int32 |
int32 |
|
Int64 |
int64 |
|
String |
string |
|
Time |
❌ [4] |
Arrow to Database¶
| Arrow Type | ClickHouse Type | |
|---|---|---|
| Bind | Ingest | |
|
binary |
❌ |
|
|
binary_view |
❌ |
|
|
bool |
❌ |
|
|
date32[day] |
❌ |
|
|
decimal128 |
❌ |
|
|
double |
❌ |
|
|
fixed_size_binary |
❌ |
|
|
float |
❌ |
|
|
halffloat |
❌ |
(NA/not tested) |
|
int16 |
❌ |
|
|
int32 |
❌ |
|
|
int64 |
❌ |
|
|
large_binary |
❌ |
|
|
large_string |
❌ |
|
|
string |
❌ |
|
|
string_view |
❌ |
|
|
time32[ms] |
❌ |
|
|
time32[s] |
❌ |
|
|
time64[ns] |
❌ |
|
|
time64[us] |
❌ |
|
|
timestamp[ms] |
❌ |
|
|
timestamp[ms] (with time zone) |
❌ |
|
|
timestamp[ns] |
❌ |
|
|
timestamp[ns] (with time zone) |
❌ |
|
|
timestamp[s] |
❌ |
|
|
timestamp[s] (with time zone) |
❌ |
|
|
timestamp[us] |
❌ |
|
|
timestamp[us] (with time zone) |
❌ |
|