chore(audit): audit any_value and expand tests#4438
Open
andygrove 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?
N/A. Autonomous audit pass.
Rationale for this change
Audit of the
any_valueexpression against Spark 3.4.3, 3.5.8, and 4.0.1.AnyValueis aRuntimeReplaceableAggregatewhosereplacementisFirst(child, ignoreNulls), and the optimizer ruleReplaceExpressionsrewrites it before physical planning. Comet therefore handlesany_valuetransparently throughCometFirst; no dedicated serde exists. The class is identical across the three Spark versions checked. Coverage infirst_last.sqlis comprehensive forfirst, but no test in the repo exercises theany_valuename directly. A regression in the analyzer rewrite, in a futureAnyValue.replacement, or in Comet's plan conversion would silently bypass that coverage.What changes are included in this PR?
spark_expressions_support.mdforany_valueacross the three Spark versions.spark/src/test/resources/sql-tests/expressions/aggregate/any_value.sqlexercisingany_valuedirectly: basic, with grouping,isIgnoreNullliteral forms, all-null groups, mixing with other aggregates, and equivalence tofirston identical inputs.How are these changes tested?
./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite any_value" -Dtest=nonepasses locally (Spark 3.5 profile, 1 test, 0 failures).Scaffolded by the
audit-comet-expression-autonomousskill.