feat: add datafusion-spark-cli, a SQL shell with the Spark functions #326
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 383 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #326"
general
weight: 0.35
kosiew
Which issue does this PR close?
Part of #56. It covers the
datafusion-cli --sparkreferences in the "Update the imported docs" item, since those READMEs now point to the new CLI.Rationale for this change
apache/datafusion#27337 removed
datafusion-cli --spark, which enabled the Spark SQL dialect and registered the Spark-compatible functions. Since then there is no way to try the functions interactively, andcrates/spark/README.mdandcrates/sqllogictest/test_files/README.mdstill tell people to rundatafusion-cli --spark.What changes are included in this PR?
crates/cli, a newdatafusion-spark-clibinary. It uses thedatafusion-clilibrary for the REPL, for running files and commands, for output formats, and for querying files by path or URL (SELECT * FROM 'data.parquet'). Itsmain.rsis about 200 lines, followingdatafusion-cli's.- Always Spark: the Spark SQL dialect and the Spark functions are always enabled. The Spark functions override DataFusion's functions of the same name.
- ANSI mode on by default, as in Spark 4 (
spark.sql.ansi.enabled = true).--ansi falsegives Spark's legacy behavior. The startup banner says which mode is on.- Options kept from
datafusion-cli:-c,-f,-r,-p,-b,--format,-q,--maxrowsand--color. The memory and disk tuning options are left out for now.publish = false.datafusion-clibrings in the object store and AWS dependencies, so a plaincargo buildorcargo testat the root skips this crate. The clippy job uses--workspace, so it still lints the crate..github/workflows/cli.yml. It builds the CLI and runs a smoke test:-
sha2returns Spark's result.-
abs(cast(-2147483648 AS int))fails by default, because ANSI mode is on.- The same query returns
-2147483648with--ansi false.crates/spark/README.md,test_files/README.md, the rootREADME.mdandAGENTS.mddescribe the new CLI.datafusion-clion DataFusion'sbranch-56still depends on that branch's owndatafusion-spark, so the build compiles that copy too. Only this repository's functions are registered. The extra copy goes away with DataFusion 57, wheredatafusion-clino longer depends ondatafusion-spark.Are these changes tested?
--helpand the banner.cargo clippy --all-targets --all-features --workspace -- -D warningsis clean.cargo test -p datafusion-sparkandcargo test -p datafusion-spark-sqllogicteststill pass.actionlintreports no problems with the new workflow.Are there any user-facing changes?
There is a new, unpublished
datafusion-spark-clibinary. You run it withcargo run -p datafusion-spark-cli._This PR was written by an LLM (Claude) and reviewed before opening._
🤖 Generated with Claude Code