feat: Wire DataFusion function Claude skill and csc #4337
Open
comphead wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Part #4150
Rationale for this change
Spark
csc(x) = 1 / sin(x)was unsupported in Comet, falling back to Spark. The upstreamdatafusion-sparkcrate (53.1.0) ships a Spark-compatibleSparkCscimplementation, so we can wire itdirectly with no native Rust written in this repo.
This PR also adds a new Claude Code skill that codifies the wiring workflow used here, so future contributors can apply the same recipe consistently.
What changes are included in this PR?
Wire Spark
Csctodatafusion-spark:spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala— registerclassOf[Csc] -> CometScalarFunction("csc")inmathExpressions.native/core/src/execution/jni_api.rs— registerSparkCscinregister_datafusion_spark_function.docs/source/user-guide/latest/expressions.md— addCscto the Math Expressions table.docs/source/contributor-guide/spark_expressions_support.md— flipcsccheckbox to supported.Upstream function:
datafusion_spark::function::math::trigonometry::SparkCsc. Wiring follows Pattern B (one-line Scala passthrough + one-line UDF registration).New Claude Code skill
wire-datafusion-function:.claude/skills/wire-datafusion-function/SKILL.md— project-level skill that walks contributors through wiring an existing DataFusion ordatafusion-sparkfunction into Comet. Documents the threewiring patterns (passthrough, UDF registration, custom serde with restrictions), the SQL-test coverage requirements (parquet-backed inputs, NULLs, FP edge cases, integer/decimal min/max), and the
hand-curated docs that must be updated. Complements the existing
implement-comet-expressionskill — used here to scaffold the csc wiring.