Skip to content

[SPARK-56585][SQL][TESTS] Replace SparkPlanTest with QueryTest#55496

Closed
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:replace-sparkplantest-with-querytest
Closed

[SPARK-56585][SQL][TESTS] Replace SparkPlanTest with QueryTest#55496
zhengruifeng wants to merge 1 commit into
apache:masterfrom
zhengruifeng:replace-sparkplantest-with-querytest

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

@zhengruifeng zhengruifeng commented Apr 23, 2026

What changes were proposed in this pull request?

Followup to SPARK-56563. Migrate every in-tree caller from the empty alias SparkPlanTest (in org.apache.spark.sql.execution, deprecated) to QueryTest (in org.apache.spark.sql). SparkPlanTest.scala itself is left untouched — the deprecated trait/object aliases remain in place for downstream compatibility.

Mechanical changes across 13 files:

extends list — dropped SparkPlanTest from the parent list. Since SharedSparkSession and QueryTest already extend QueryTest (directly or transitively), the former SparkPlanTest reference was a pure duplicate:

File Before After
ReuseExchangeAndSubquerySuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
SortSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
ExchangeSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
BroadcastExchangeSuite extends SparkPlanTest with SharedSparkSession with AdaptiveSparkPlanHelper extends SharedSparkSession with AdaptiveSparkPlanHelper
TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
BaseScriptTransformationSuite extends SparkPlanTest with QueryTest extends QueryTest
ExtractPythonUDFsSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
BatchEvalPythonExecSuite extends SparkPlanTest with SharedSparkSession with AdaptiveSparkPlanHelper extends SharedSparkSession with AdaptiveSparkPlanHelper
SingleJoinSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
InnerJoinSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession
OuterJoinSuite extends SparkPlanTest with SharedSparkSession with SQLTestData extends SharedSparkSession with SQLTestData
ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession extends SharedSparkSession

Static callsSparkPlanTest.executePlan -> QueryTest.executePlan in:

  • BaseScriptTransformationSuite
  • SingleJoinSuite
  • HiveScriptTransformationSuite (4 call sites)

Imports — removed SparkPlanTest from the org.apache.spark.sql.execution.{...} import lines in BatchEvalPythonExecSuite, ExtractPythonUDFsSuite, ExistenceJoinSuite, OuterJoinSuite, SingleJoinSuite. Added import org.apache.spark.sql.QueryTest to SingleJoinSuite and HiveScriptTransformationSuite for the static-method calls.

Why are the changes needed?

Finishes the consolidation started in SPARK-56563 by migrating every in-tree caller to the canonical QueryTest in org.apache.spark.sql, so in-tree callers no longer trigger the deprecation warning on SparkPlanTest. The deprecated alias is still available for any downstream users.

Does this PR introduce any user-facing change?

No, test-only.

How was this patch tested?

Locally compiled sql/Test/compile and hive/Test/compile successfully. Ran SingleJoinSuite (36 tests), ExchangeSuite + ReuseExchangeAndSubquerySuite (10 tests total) — all pass. Relying on CI for full test run.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

### What changes were proposed in this pull request?

Followup to SPARK-56563. Migrate all call sites from the empty alias
`SparkPlanTest` (in `org.apache.spark.sql.execution`) to `QueryTest`
(in `org.apache.spark.sql`). The deprecated alias `SparkPlanTest` is
left in place for downstream compatibility.

Mechanical changes across 13 files:
- `extends SparkPlanTest with SharedSparkSession` -> `extends SharedSparkSession`
  (dropping duplicate — `SharedSparkSession` already extends `QueryTest`)
- `extends SparkPlanTest with QueryTest` -> `extends QueryTest`
  (dropping duplicate)
- `SparkPlanTest.executePlan` -> `QueryTest.executePlan`
- Removed `SparkPlanTest` from `org.apache.spark.sql.execution.{...}`
  import lines

### Why are the changes needed?

Finishes the consolidation started in SPARK-56563 by migrating every
in-tree caller to the canonical `QueryTest` in `org.apache.spark.sql`,
so in-tree callers no longer trigger the deprecation warning on
`SparkPlanTest`.

### Does this PR introduce _any_ user-facing change?

No, test-only.

### How was this patch tested?

Locally compiled `sql/Test/compile` and `hive/Test/compile` successfully.
Ran `SingleJoinSuite` (36 tests), `ExchangeSuite` and
`ReuseExchangeAndSubquerySuite` (10 tests total) — all pass. Relying on
CI for full test run.

### Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7
@zhengruifeng
Copy link
Copy Markdown
Contributor Author

merged to master

@zhengruifeng zhengruifeng deleted the replace-sparkplantest-with-querytest branch April 23, 2026 04:04
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