Answers / Get data into your AI
How do I load Parquet files so an AI can query them?
Recipe verified on
Ran on a private test instance
Short answer
Sync the folder with cdb-localdata, the same as CSV: each .parquet file becomes a table, with its column types kept. Your AI queries it over MCP with exact results. ORC files work the same way.
Steps
- Connect your assistant to your instance (this writes, so it needs your own instance with a ReadWrite key
from the accounts portal; the public demo is read-only). In Claude Code:
claude mcp add --transport http mcpdata https://[you].mcpdata.org/mcp --header "Authorization: Bearer $CDB_API_KEY"
Replace
[you]with your instance's name. Other apps: Connect your AI. - Install the client and sign it in.
pip install https://[you].mcpdata.org/help/download/cdb-0.3.4-py3-none-any.whl cdb-localdata login --to https://[you].mcpdata.org
- Add the folder and sync it. Here the sample orders_sample.parquet:
cdb-localdata add ./samples/parquet --to https://[you].mcpdata.org --namespace pq cdb-localdata sync
- Ask your question. Give your AI this prompt:
Using mcpdata, average order value per channel in pq.orders_sample.
What your AI does: the tool calls it makes for this prompt, and what came back
describe_table(table_name="pq.orders_sample") → 15 columns, 100,000 rows
query(table_name="pq.orders_sample", group_by=["channel"], agg=[{"func": "avg", "column": "revenue", "alias": "avg_order_value"}, {"func": "count", "column": "order_id", "alias": "orders"}]) → 3 rows
| channel | avg_order_value | orders |
|---|---|---|
| Store | 537.14 | 32,938 |
| Online | 531.47 | 55,059 |
| Partner | 534.86 | 12,003 |
The assistant needs mcpdata connected (step 1) to run the query.
Why this works
Parquet already carries column names and types, so nothing is guessed on the way in: integers stay integers and timestamps stay timestamps. Loading keeps the data columnar, which suits the summaries an AI asks for.