test: add sql-file test confirming fallback on parquet variant reads#4021
Merged
andygrove merged 1 commit intoapache:mainfrom Apr 21, 2026
Merged
test: add sql-file test confirming fallback on parquet variant reads#4021andygrove merged 1 commit intoapache:mainfrom
andygrove merged 1 commit intoapache:mainfrom
Conversation
Adds a Spark 4.0+ sql-file test that creates parquet-backed tables with a VARIANT column (both directly and nested inside a struct) and asserts Comet falls back to Spark with reason "Unsupported v of type VariantType" for projection, filter, and aggregation queries. Gated by MinSparkVersion: 4.0 so older Spark profiles skip it.
kazuyukitanimura
approved these changes
Apr 21, 2026
Contributor
kazuyukitanimura
left a comment
There was a problem hiding this comment.
Thanks.
We can add more cases later but good start
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 #1637
Rationale for this change
Comet does not support Spark 4.0's
VARIANTdata type, so scans exposing a VariantType column must fall back to Spark. There is no regression test pinning this behavior today. If a future change silently lets a VariantType column through the scan, we would only notice through runtime errors or wrong results. A targeted sql-file test locks in the fallback contract.What changes are included in this PR?
spark/src/test/resources/sql-tests/expressions/misc/variant.sql-- MinSparkVersion: 4.0so it is skipped on Spark 3.4 / 3.5 viaCometSqlFileTestSuiteVARIANTcolumn (directly and nested insideSTRUCT<v: VARIANT>), populated viaparse_jsonquery expect_fallback(Unsupported v of type VariantType)on five queries covering projection,variant_getextraction,variant_getin a predicate, aCOUNT(*)with a not-null filter, and a struct-containing-variant projectionHow are these changes tested?
Ran the new test under the Spark 4.0 profile:
All five queries in the file fall back with the expected reason and the suite reports
Tests: succeeded 1, failed 0.