Apache DataFusion CLI
$ datafusion-cli Foundation Low Riskdatafusion-cli is the official command-line query engine for Apache DataFusion. Built in Rust on Apache Arrow, it queries local or S3/GCS Parquet, CSV, Avro, and NDJSON files via -c with vectorized execution and --format json / --format nd-json output.
brew install datafusion Runs vectorized Arrow SQL queries locally or against S3 Parquet with --format json, avoiding loading multi-megabyte data files into agent memory.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -c one-shot execution, -f SQL files, --format json / nd-json / csv, and --quiet mode.
- Supports
-c,--format json, and--format nd-json
Read-only SQL queries by default; file writes require explicit COPY ... TO SQL statements.
- In-process read-only query execution unless
COPYis invoked
Rust binary available via Homebrew, cargo install datafusion-cli, and Apache/GitHub releases across macOS, Linux, and Windows.
- Distributed via
brew install datafusionandcargo
Vectorized Arrow SQL engine handles Parquet, CSV, JSON, Avro, and S3/GCS object stores at high speed.
- Vectorized Arrow engine with S3/GCS and Parquet support
Top-level Apache Software Foundation project (apache/datafusion) under Apache-2.0 with very active development.
- Official ASF
apache/datafusionrepository
Comprehensive official CLI user guide and SQL reference on datafusion.apache.org.
- Official CLI docs at datafusion.apache.org
Security, Auth & Guardrails
None for local files; reads AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION or GOOGLE_APPLICATION_CREDENTIALS env vars for object-store URIs.
Apache-2.0 open-source CLI; free (remote S3/GCS queries incur cloud egress/request fees).
# datafusion-cli Agent Rules - Always pass `-c "<sql>"` (or `-f <script.sql>`) and `--format json` / `--format nd-json`; bare `datafusion-cli` enters an interactive REPL. - Include `LIMIT` on `SELECT` queries and avoid `COPY ... TO` unless file export is requested.
Agent-Ready Command Recipes
Safe Read-Only Queries
datafusion-cli --format json -c "SELECT * FROM 'events.parquet' LIMIT 20"
Executes a bounded SQL query over Parquet and emits JSON without entering the REPL.
datafusion-cli --format nd-json -c "DESCRIBE 'events.parquet'"
Prints column names and Arrow types as newline-delimited JSON.
Strengths for Agents
- + Blazing-fast vectorized Rust/Arrow SQL execution over Parquet, Avro, CSV, and JSON.
- + Native
--format jsonand--format nd-jsonpair cleanly with-c. - + Supports
s3://andgs://object store queries out of the box.
Caveats & Pitfalls
- ! Running
datafusion-cliwithout-cor-fopens an interactive SQL REPL. - ! Memory limits (
-m) should be set when querying huge unpartitioned datasets in constrained sandboxes.