docs(spark): generate function reference from #[user_doc] #115
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 316 lines diff across 3 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.345
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #115"
general
weight: 0.35
kosiew
Part of #55
Rationale
The recent
#[user_doc]PRs (#58, #103–#107) attach user documentation to most functions, but nothing in the repo renders it.cargo docdoesn't show it either, since#[user_doc]builds a runtimeDocumentationvalue rather than rustdoc, and those PRs cut the rustdoc down to a one-line summary. So the docs can't be read anywhere yet.Changes
crates/docgen(datafusion-spark-docgen,publish = false) with aprint_functions_docsbinary. It is based on DataFusion'sprint_functions_docs. It writes Markdown for all scalar, aggregate and window functions returned byall_default_*_functions(), with arguments, examples, alternative syntax and aliases.- Output goes to
docs/functions, with one page per function type and doc section (for examplescalar/math.md) and aREADME.mdindex. The index links each section with its function count, then lists every function and alias alphabetically. A single page was about 2,500 lines already and would reach roughly 10,000 with full Spark coverage.- Sections follow DataFusion's order. Sections DataFusion doesn't define (
JSON Functions,URL Functions) come after, sorted by label.- Unlike DataFusion, it doesn't fail on undocumented functions, because #55 is still in progress. It lists them on stderr instead (10 right now:
array_contains,map_from_arrays,map_from_entries,mod,parse_url,pmod,spark_cast,str_to_map,try_parse_url,xxhash64).dev/update_function_docs.sh, which generates into a temporary directory and replacesdocs/functionsonly on success, and commit the generated pages.function docs up to datejob tolint.ymlthat regenerates the pages and fails ifgit status --porcelain -- docs/functionsreports any change, including deleted or untracked files.CONTRIBUTING.mdandAGENTS.md, and link the reference from the READMEs and crate docs.The published
datafusion-sparkcrate is unchanged apart from a doc comment link.Testing
cargo fmt --all -- --check,cargo clippy --all-targets --all-features --workspace -- -D warnings,cargo test -p datafusion-sparkandcargo test -p datafusion-spark-sqllogictestpass.dev/update_function_docs.shand checked the rendered pages. The split pages contain the same functions and aliases as the earlier single page, and a second run leaves the tree clean.cargofail during generation and checked that the existing pages were left untouched.