chDB is an embedded SQL OLAP engine powered by ClickHouse.

features

  • SQL OLAP engine embedded in Python, powered by ClickHouse
  • No need to install ClickHouse
  • Supports Parquet, CSV, JSON, Arrow, ORC, and more than 60 other formatsinput Output,example.

Currently, chDB only supports Python 3.7+ on macOS (x86_64 and ARM64) and Linux.

usage

run on the command line

python3 -m chdb SQL [OutputFormat]

python3 -m chdb "SELECT 1,'abc'" Pretty

Currently, chDB only supports query A function that executes SQL and returns data in the desired format.

import chdb
res = chdb.query('select version()', 'Pretty'); print(res.data())

Use Parquet or CSV

# 查看更多数据类型格式,请参见 tests/format_output.py
res = chdb.query('select * from file("data.parquet", Parquet)', 'JSON'); print(res.data())
# 对于大型数据结果,get_memview() 更快,因为它不需要额外的数据复制。
res = chdb.query('select * from file("data.csv", CSV)', 'CSV');  print(str(res.get_memview().tobytes()))

Pandas DataFrame output

# 更多内容请参见 https://clickhouse.com/docs/en/interfaces/formats
chdb.query('select * from file("data.parquet", Parquet)', 'Dataframe')

#chDB #Homepage #Documentation #Download #Embedded #SQL #OLAP #Engine #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *