clickhouse-arrow-0.2.1
توضیحات
A minimal client that uses the ClickHouse HTTP API and Apache Arrow.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | clickhouse-arrow-0.2.1 |
| نام | clickhouse-arrow |
| نسخه کتابخانه | 0.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Martin Galpin |
| ایمیل نویسنده | galpin@galpin.com |
| آدرس صفحه اصلی | https://github.com/galpin/clickhouse-arrow |
| آدرس اینترنتی | https://pypi.org/project/clickhouse-arrow/ |
| مجوز | - |
# Clickhouse Arrow 🏠 🏹
A minimal [ClickHouse](https://clickhouse.com) client that uses the HTTP API and Apache Arrow.
You should probably use [Clickhouse Connect](https://github.com/ClickHouse/clickhouse-connect) instead.
### Installation
```bash
pip install clickhouse_arrow
```
### Examples
```python
import clickhouse_arrow as ch
import pyarrow as pa
# Initialise a client
client = ch.Client("http://localhost:8123", password="password")
# Create a table
client.execute(
"""
CREATE TABLE test (
col1 Int64,
col2 String
)
ENGINE = Memory
""",
)
# Import a table
table = pa.Table.from_pydict(
{
"col1": [1, 2, 3],
"col2": ["a", "b", "d"],
},
)
client.insert("test", table)
# Read into a table
table = client.read_table("SELECT * FROM test")
print(table)
# Read iterator of batches
batches = client.read_batches("SELECT * FROM test")
for batch in batches:
print(batch)
# Use query parameters
table = client.read_table(
"""
SELECT * FROM test
WHERE col1 = {value:Int64}
""",
params={"value": 2},
)
print(table)
# Use query settings
table = client.read_table(
"SELECT col2 FROM test",
settings={"output_format_arrow_string_as_string": 1},
)
print(table["col2"])
```
نیازمندی
| مقدار | نام |
|---|---|
| >=11.0.0,<12.0.0 | pyarrow |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9,<4.0 | Python |
نحوه نصب
نصب پکیج whl clickhouse-arrow-0.2.1:
pip install clickhouse-arrow-0.2.1.whl
نصب پکیج tar.gz clickhouse-arrow-0.2.1:
pip install clickhouse-arrow-0.2.1.tar.gz