Skip to content

Port sum with Spark overflow semantics from Comet #160

Open

Description

@andygrove

Note

An LLM (Claude Code) created this issue. It compared the native expressions in Apache DataFusion Comet (native/spark-expr) with the functions in this crate. Check the details before you rely on them.

Is your feature request related to a problem or challenge?

Comet has a native, Spark-compatible implementation of sum with Spark overflow semantics that datafusion-spark does not have.

Spark expressions: sum

Comet source (at 3878424d9):

Integral sum returns BIGINT and raises on overflow in ANSI mode; decimal sum returns NULL or raises on overflow. try_sum is already in this crate.

Describe the solution you'd like

Port the implementation and its tests from Comet into datafusion-spark, and add .slt cases under crates/sqllogictest. Comet can then use the datafusion-spark version and remove its copy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions