test: add SQL file tests for RuntimeReplaceable functions accelerated by Comet#4562
Merged
Merged
Conversation
mbutrovich
approved these changes
Jun 2, 2026
Contributor
mbutrovich
left a comment
There was a problem hiding this comment.
I will never say no to more tests, thanks @andygrove!
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. This adds test coverage only. Surfaces #4560.
Rationale for this change
A sweep of
RuntimeReplaceableSpark functions found several that Comet already accelerates (they lower to expressions Comet supports) but which had no test coverage guarding that behavior. These tests pin the acceleration so it cannot silently regress.What changes are included in this PR?
Adds SQL file tests for functions confirmed to run natively in Comet:
conditional/nullif_zeroif.sql-nullifzero,zeroifnull(lower toif/coalesce).MinSparkVersion: 4.0.misc/equal_null.sql-equal_null(lowers to<=>).misc/uniform.sql-uniformwith fixed-seed literal args (lowers toRand-based arithmetic).MinSparkVersion: 4.0.array/array_size.sql-array_size(lowers tosize). The NULL-array case isignored pending array_size returns -1 instead of NULL for NULL input #4560 (returns -1 instead of NULL).array/try_element_at.sql-try_element_atfor arrays (lowers toelement_at); map input falls back (spark_answer_only).string/to_binary.sql-to_binary(x, 'hex')(lowers tounhex); UTF-8/base64 formats fall back (spark_answer_only).string/collation.sql-collation(folds to a literal).MinSparkVersion: 4.0.How are these changes tested?
This PR is test-only. The files run under
CometSqlFileTestSuite, executing each query through both Spark and Comet and comparing results; defaultqueryblocks additionally assert native (non-fallback) execution. Verified locally with./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite" -Dtest=none.