[SPARK-56591][SQL][TESTS][FOLLOW-UP] Drop redundant QueryTest mixin from SharedSparkSession-based test suites#55792
Closed
zhengruifeng wants to merge 1 commit into
Closed
Conversation
…parkSession-based test suites SharedSparkSession already extends QueryTest, so explicitly writing `QueryTest with SharedSparkSession` in test suite extends clauses is redundant. Drop the redundant `QueryTest` term across 11 sql/core test files and remove the now-unused QueryTest imports where applicable. Generated-by: Claude Code
HyukjinKwon
approved these changes
May 12, 2026
zhengruifeng
added a commit
that referenced
this pull request
May 12, 2026
…rom SharedSparkSession-based test suites ### What changes were proposed in this pull request? Drop the redundant `QueryTest` term from `extends QueryTest with SharedSparkSession` (and its multi-line variants) across 11 test suites in `sql/core`. Where `QueryTest` was only imported to satisfy the extends clause, the import is also removed. Affected files: - `sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2ExtSessionColumnIdSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2MetadataTableSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2MetadataViewSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTableNetChangesSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTablePostProcessingSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTableStreamingPostProcessingSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/execution/MetricViewV2CatalogSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/execution/UnionCodegenSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/execution/window/SegmentTreeWindowFunctionSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/execution/window/SegmentTreeWindowMetricsSuite.scala` - `sql/core/src/test/scala/org/apache/spark/sql/execution/window/WindowSegmentTreeAllowlistSuite.scala` Suites that reference `QueryTest.<member>` in the body (only `SegmentTreeWindowFunctionSuite` via `QueryTest.sameRows`) keep the import. ### Why are the changes needed? `SharedSparkSession` already extends `QueryTest`: ```scala trait SharedSparkSession extends QueryTest with SharedSparkSessionBase ``` so an explicit `extends QueryTest with SharedSparkSession` on each suite is redundant and slightly misleading about the trait hierarchy. Dropping it reduces noise and lowers the chance of the pattern being copied into new suites. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests; `build/sbt sql/Test/compile` passes cleanly on the affected sources. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code Closes #55792 from zhengruifeng/cleanup-querytest-mixin. Authored-by: Ruifeng Zheng <ruifengz@apache.org> Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com> (cherry picked from commit 4678f71) Signed-off-by: Ruifeng Zheng <ruifengz@foxmail.com>
Contributor
Author
|
merged to master/4.x |
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.
What changes were proposed in this pull request?
Drop the redundant
QueryTestterm fromextends QueryTest with SharedSparkSession(and its multi-line variants) across 11 test suites insql/core. WhereQueryTestwas only imported to satisfy the extends clause, the import is also removed.Affected files:
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2ExtSessionColumnIdSuite.scalasql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2MetadataTableSuite.scalasql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2MetadataViewSuite.scalasql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTableNetChangesSuite.scalasql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTablePostProcessingSuite.scalasql/core/src/test/scala/org/apache/spark/sql/connector/ResolveChangelogTableStreamingPostProcessingSuite.scalasql/core/src/test/scala/org/apache/spark/sql/execution/MetricViewV2CatalogSuite.scalasql/core/src/test/scala/org/apache/spark/sql/execution/UnionCodegenSuite.scalasql/core/src/test/scala/org/apache/spark/sql/execution/window/SegmentTreeWindowFunctionSuite.scalasql/core/src/test/scala/org/apache/spark/sql/execution/window/SegmentTreeWindowMetricsSuite.scalasql/core/src/test/scala/org/apache/spark/sql/execution/window/WindowSegmentTreeAllowlistSuite.scalaSuites that reference
QueryTest.<member>in the body (onlySegmentTreeWindowFunctionSuiteviaQueryTest.sameRows) keep the import.Why are the changes needed?
SharedSparkSessionalready extendsQueryTest:so an explicit
extends QueryTest with SharedSparkSessionon each suite is redundant and slightly misleading about the trait hierarchy. Dropping it reduces noise and lowers the chance of the pattern being copied into new suites.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests;
build/sbt sql/Test/compilepasses cleanly on the affected sources.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code