Skip to content

[SPARK-56591][SQL][TESTS][FOLLOW-UP] Drop redundant QueryTest mixin from SharedSparkSession-based test suites#55792

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:cleanup-querytest-mixin
Closed

[SPARK-56591][SQL][TESTS][FOLLOW-UP] Drop redundant QueryTest mixin from SharedSparkSession-based test suites#55792
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:cleanup-querytest-mixin

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

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:

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

…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
@zhengruifeng zhengruifeng changed the title [SPARK-XXXXX][SQL][TESTS] Drop redundant QueryTest mixin from SharedSparkSession-based test suites [SPARK-56591][SQL][TESTS][FOLLOW-UP] Drop redundant QueryTest mixin from SharedSparkSession-based test suites May 11, 2026
@zhengruifeng zhengruifeng marked this pull request as ready for review May 11, 2026 23:56
@zhengruifeng zhengruifeng requested a review from HyukjinKwon May 11, 2026 23:56
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>
@zhengruifeng
Copy link
Copy Markdown
Contributor Author

merged to master/4.x

@zhengruifeng zhengruifeng deleted the cleanup-querytest-mixin branch May 12, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants