跳到主内容
智客 ZICQ

技能库 智客分类:数据与分析 chdb-datastore

Chdb Datastore

当用户拥有表格数据(熊猫DataFrame,parquet,csv,Arrow,json)并想过滤,组分,聚合,加入,或加速慢快熊猫时使用. 提供chDB DataStore——同为熊猫API,ClickHouse引擎下方. 还处理从S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake 读取数据Frames, 并加入跨来源. 当:用户提及 DataFrame, parquet, csv, "快活熊猫", "快活熊猫", 或交叉源 DataFrame 加入时; 用户导入 `chdb.datastore' 或`从 Datastore 导入 DataStore' 。 SKIP此技能用于原始的SQL语法(取而代之使用chdb-sql),ClickHouse服务器管理,或非Python DataStore API工作.

7344 安装量

官方网址:作者主页

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

当用户拥有表格数据(熊猫DataFrame,parquet,csv,Arrow,json)并想过滤,组分,聚合,加入,或加速慢快熊猫时使用. 提供chDB DataStore——同为熊猫API,ClickHouse引擎下方. 还处理从S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake 读取数据Frames, 并加入跨来源. 当:用户提及 DataFrame, parquet, csv, "快活熊猫", "快活熊猫", 或交叉源 DataFrame 加入时; 用户导入 `chdb.datastore' 或`从 Datastore 导入 DataStore' 。 SKIP此技能用于原始的SQL语法(取而代之使用chdb-sql),ClickHouse服务器管理,或非Python DataStore API工作.

何时用

用户拥有表格数据(pandas DataFrame,parquet,csv,Arrow,json),并想过滤,组装,聚合,加入,或加速慢熊猫. 提供chDB DataStore——同为熊猫API,ClickHouse引擎下方. 还处理从 S3, MySQL, PostgreSQL, MongoDB, 点击读取 浩爷

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:chdb DataStore — It's Just Faster Pandas、The Key Insight、Change this:、To this:、Everything else stays the same.、Decision Tree: Pick the Right Approach。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/connectors.md、references/api-reference.md、scripts/verify_install.py,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake as DataFrames and joining across sources. TRIGGER when: user mentions DataFrame, parquet, csv, "fast pandas", "speed up pandas", or cross-source DataFrame joins; user imports `chdb.datastore` or `from datastore import DataStore`. SKIP this skill for raw SQL syntax (use chdb-sql instead), ClickHouse server administration, or non-Python DataStore API work.

chdb DataStore — It's Just Faster PandasThe Key InsightChange this:To this:Everything else stays the same.Decision Tree: Pick the Right ApproachConnect to Any Data Source — One PatternLocal file (auto-detects .parquet, .csv, .json, .arrow, .orc, .avro, .tsv, .xml)DatabaseCloud storageURI shorthand — auto-detects source typeAfter Connecting — Full Pandas API

兼容:Requires Python 3.9+, macOS or Linux. pip install chdb. · 许可:Apache-2.0

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
chdb-datastore
description
Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake as DataFrames and joining across sources. TRIGGER when: user mentions DataFrame, parquet, csv, "fast pandas", "speed up pandas", or cross-source DataFrame joins; user imports `chdb.datastore` or `from datastore import DataStore`. SKIP this skill for raw SQL syntax (use chdb-sql instead), ClickHouse server administration, or non-Python DataStore API work.
compatibility
Requires Python 3.9+, macOS or Linux. pip install chdb.
许可
Apache-2.0
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 3
  • references/connectors.md
  • references/api-reference.md
  • scripts/verify_install.py

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「chdb-datastore」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-1373c6d139d4e760-%E6%95%B0%E6%8D%AE%E5%AD%98%E5%82%A8%E5%99%A8.html
请存为 .cursor/skills/chdb-datastore/SKILL.md 或 .claude/skills/chdb-datastore/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/clickhouse/agent-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/clickhouse/agent-skills' --list

npx skills add 'https://github.com/clickhouse/agent-skills' --skill 'chdb-datastore'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

name: chdb-datastore description: >- Use when the user has tabular data (pandas DataFrame, parquet, csv, Arrow, json) and wants to filter, group, aggregate, join, or speed up slow pandas. Provides chDB DataStore — same pandas API, ClickHouse engine underneath. Also handles reading from S3, MySQL, PostgreSQL, MongoDB, ClickHouse Cloud, Iceberg, Delta Lake as DataFrames and joining across sources. TRIGGER when: user mentions DataFrame, parquet, csv, "fast pandas", "speed up pandas", or cross-source DataFrame joins; user imports chdb.datastore or from datastore import DataStore. SKIP this skill for raw SQL syntax (use chdb-sql instead), ClickHouse server administration, or non-Python DataStore API work. license: Apache-2.0 compatibility: Requires Python 3.9+, macOS or Linux. pip install chdb. metadata: author: chdb-io version: "4.1" homepage: https://clickhouse.com/docs/chdb

chdb DataStore — It's Just Faster Pandas

The Key Insight

# Change this:
import pandas as pd
# To this:
import chdb.datastore as pd
# Everything else stays the same.

DataStore is a lazy, ClickHouse-backed pandas replacement. Your existing pandas code works unchanged — but operations compile to optimized SQL and execute only when results are needed (e.g., print(), len(), iteration).

pip install chdb

Decision Tree: Pick the Right Approach

1. "I have a file/database and want to analyze it with pandas"
   → DataStore.from_file() / from_mysql() / from_s3() etc.
   → See references/connectors.md

2. "I need to join data from different sources"
   → Create DataStores from each source, use .join()
   → See examples/examples.md #3-5

3. "My pandas code is too slow"
   → import chdb.datastore as pd — change one line, keep the rest

4. "I need raw SQL queries"
   → Use the chdb-sql skill instead

Connect to Any Data Source — One Pattern

from datastore import DataStore

# Local file (auto-detects .parquet, .csv, .json, .arrow, .orc, .avro, .tsv, .xml)
ds = DataStore.from_file("sales.parquet")

# Database
ds = DataStore.from_mysql(host="db:3306", database="shop", table="orders", user="root", password="pass")

# Cloud storage
ds = DataStore.from_s3("s3://bucket/data.parquet", nosign=True)

# URI shorthand — auto-detects source type
ds = DataStore.uri("mysql://root:pass@db:3306/shop/orders")

All 16+ sources and URI schemes → connectors.md

After Connecting — Full Pandas API

result = ds[ds["age"] > 25]                                          # filter
result = ds[["name", "city"]]                                        # select columns
result = ds.sort_values("revenue", ascending=False)                  # sort
result = ds.groupby("dept")["salary"].mean()                         # groupby
result = ds.assign(margin=lambda x: x["profit"] / x["revenue"])     # computed column
ds["name"].str.upper()                                               # string accessor
ds["date"].dt.year                                                   # datetime accessor
result = ds1.join(ds2, on="id")                                      # join
result = ds.head(10)                                                 # preview
print(ds.to_sql())                                                   # see generated SQL

209 DataFrame methods supported. Full API → api-reference.md

Cross-Source Join — The Killer Feature

from datastore import DataStore

customers = DataStore.from_mysql(host="db:3306", database="crm", table="customers", user="root", password="pass")
orders = DataStore.from_file("orders.parquet")

result = (orders
    .join(customers, left_on="customer_id", right_on="id")
    .groupby("country")
    .agg({"amount": "sum", "rating": "mean"})
    .sort_values("sum", ascending=False))
print(result)

More join examples → examples.md

Writing Data

source = DataStore.from_mysql(host="db:3306", database="shop", table="orders", user="root", password="pass")
target = DataStore("file", path="summary.parquet", format="Parquet")

target.insert_into("category", "total", "count").select_from(
    source.groupby("category").select("category", "sum(amount) AS total", "count() AS count")
).execute()

Troubleshooting

| Problem | Fix | |---------|-----| | ImportError: No module named 'chdb' | pip install chdb | | ImportError: cannot import 'DataStore' | Use from datastore import DataStore or from chdb.datastore import DataStore | | Database connection timeout | Include port in host: host="db:3306" not host="db" | | Join returns empty result | Check key types match (both int or both string); use .to_sql() to inspect | | Unexpected results | Call ds.to_sql() to see the generated SQL and debug | | Environment check | Run python scripts/verify_install.py (from skill directory) |

References

Note: This skill teaches how to use chdb DataStore. For raw SQL queries, use the chdb-sql skill. For contributing to chdb source code, see CLAUDE.md in the project root.

相关技能

数据与分析

Marketing Skills

TL; DR:23个营销剧本(CRO,SEO,拷贝,分析,实验,定价,发布,广告,社交). 用于快速获取清单+副本/粘贴可交付品.

数据与分析

Crypto & Stock Market Data (Node.js)

免费等级不需要 API 关键值 。 专业级别的密码货币和股票市场数据集成,用于实时价格、公司概况和全球分析。 由Node.js提供动力,外部依赖性为零.

数据与分析

Azure Storage

Azure存储服务包括Blob存储,文件共享,等式存储,表存储,和数据湖. 解答关于存储访问级别(热,凉,冷,存档),何时使用每个级别,以及级别比较的问题. 提供对象存储,SMB文件共享,async消息,NoSQL密钥-值,和大数据分析. 包括生命周期管理。 USE FOR: b…

数据与分析

Azure Kusto

Azure Data Explorer(Kusto/ADX)中使用KQL进行日志分析,遥测和时间序列分析的查询并分析数据. When: KQL 查询, Kusto 数据库查询, Azure Data Explorer, ADX 集群, 日志分析, 时间序列数据, IoT 遥测, …