chDB-core is an in-process OLAP SQL Engine, embedding the powerful analytical capabilities of ClickHouse directly within Python applications. It allows users to execute high-performance SQL queries without the need for a separate ClickHouse server installation or network communication. The library maintains an active development and release cadence, with version 26.1.0 being the current stable release.
pip install chdb-coreVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to perform a basic SQL query using the `chdb.query` function and how to get results in different formats, including a Pandas DataFrame. The `chdb-core` package exposes its primary functionalities via the `chdb` module.
Ensure you install the correct package: `pip install chdb-core` for core SQL engine, or `pip install chdb` for DataStore API built on `chdb-core`.
Optimize queries to reduce memory footprint, process data in chunks (streaming), or consider using a separate ClickHouse server for extremely large or long-running tasks. Monitor memory usage carefully for in-process deployments.
Design UDFs as pure functions without side effects. For example, `def my_udf(arg1, arg2): import json; return str(json.loads(arg1)['key'])`. Explicitly cast string inputs to appropriate types (e.g., `int(lhs)`, `float(rhs)`) and cast the result back to string if not specifying a return type.