docs: mark try_avg and try_sum as natively supported#4776
Merged
Conversation
marvelshan
pushed a commit
to marvelshan/datafusion-comet
that referenced
this pull request
Jul 2, 2026
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 of #4098.
Rationale for this change
try_avgandtry_sumwere already fully implemented and tested natively: both parse to Spark'sAverage/Sumaggregates withEvalMode.TRY, which Comet's serde already plumbs through to the native accumulators (SumInteger,SumDecimal,AvgDecimalall handleTrymode, including overflow-to-NULLsemantics).CometAggregateSuitealready covers integer overflow, partial-overflow withGROUP BY, decimal overflow, null handling, and ANSI/non-ANSI combinations, and these tests pass withcheckSparkAnswerAndOperator(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.mdto marktry_avgandtry_sumas supported (✅), matching their non-trycounterparts (avgnotes that interval types fall back;sumhas no caveat).This change was scoped using the
implement-comet-expressionskill, 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_sumtests inCometAggregateSuitepass (10 tests, 0 failures), verifying native execution and Spark-matching results across overflow, group-by, decimal, and null cases.