Skip to content

docs: mark try_avg and try_sum as natively supported#4776

Merged
mbutrovich merged 1 commit into
apache:mainfrom
andygrove:try-avg-sum
Jun 30, 2026
Merged

docs: mark try_avg and try_sum as natively supported#4776
mbutrovich merged 1 commit into
apache:mainfrom
andygrove:try-avg-sum

Conversation

@andygrove

Copy link
Copy Markdown
Member

Which issue does this PR close?

Part of #4098.

Rationale for this change

try_avg and try_sum were already fully implemented and tested natively: both parse to Spark's Average/Sum aggregates with EvalMode.TRY, which Comet's serde already plumbs through to the native accumulators (SumInteger, SumDecimal, AvgDecimal all handle Try mode, including overflow-to-NULL semantics). CometAggregateSuite already covers integer overflow, partial-overflow with GROUP BY, decimal overflow, null handling, and ANSI/non-ANSI combinations, and these tests pass with checkSparkAnswerAndOperator (confirming native execution and a match against Spark).

The only stale artifact was the expression support guide, which still listed both as not-yet-supported.

What changes are included in this PR?

Update docs/source/user-guide/latest/expressions.md to mark try_avg and try_sum as supported (✅), matching their non-try counterparts (avg notes that interval types fall back; sum has no caveat).

This change was scoped using the implement-comet-expression skill, which surfaced that the native implementation and test coverage already existed and that only the documentation needed updating.

How are these changes tested?

Existing try_avg/try_sum tests in CometAggregateSuite pass (10 tests, 0 failures), verifying native execution and Spark-matching results across overflow, group-by, decimal, and null cases.

@mbutrovich mbutrovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @andygrove!

@mbutrovich mbutrovich merged commit 055b0c9 into apache:main Jun 30, 2026
16 checks passed
marvelshan pushed a commit to marvelshan/datafusion-comet that referenced this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants