Skip to content

[SPARK-56560][SQL][TESTS] Replace SQLTestUtils/SQLTestUtilsBase with QueryTest/QueryTestBase#55445

Closed
zhengruifeng wants to merge 4 commits into
apache:masterfrom
zhengruifeng:replace-sqltestutils-with-querytest
Closed

[SPARK-56560][SQL][TESTS] Replace SQLTestUtils/SQLTestUtilsBase with QueryTest/QueryTestBase#55445
zhengruifeng wants to merge 4 commits into
apache:masterfrom
zhengruifeng:replace-sqltestutils-with-querytest

Conversation

@zhengruifeng
Copy link
Copy Markdown
Contributor

@zhengruifeng zhengruifeng commented Apr 21, 2026

What changes were proposed in this pull request?

Followup to SPARK-55910. Migrate all call sites from the empty alias traits SQLTestUtils/SQLTestUtilsBase and the SQLTestUtils.compareAnswers alias to QueryTest/QueryTestBase and QueryTest.compareAnswers directly, and mark the aliases as @deprecated (scheduled for removal after downstream usages migrate).

Mechanical changes across 68 files:

  • extends/with SQLTestUtils -> extends/with QueryTest (dropped duplicate when QueryTest was already in the parent list)
  • extends/with SQLTestUtilsBase -> extends/with QueryTestBase
  • SQLTestUtils.compareAnswers -> QueryTest.compareAnswers
  • Import lines rewritten to org.apache.spark.sql.{QueryTest, QueryTestBase} (different package from the old aliases)
  • Updated two stale SQLTestUtils/SQLTestUtilsBase mentions in code comments

In sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala:

  • Added @deprecated("Use QueryTest directly instead.", "4.2.0") on trait SQLTestUtils and object SQLTestUtils
  • Added @deprecated("Use QueryTestBase directly instead.", "4.2.0") on trait SQLTestUtilsBase
  • The empty alias traits and the thin compareAnswers delegate remain in place for backward compatibility.

Why are the changes needed?

Finishes the consolidation started in SPARK-55910 by migrating every in-tree caller to the canonical QueryTest/QueryTestBase in org.apache.spark.sql, and flagging the aliases so any remaining (or downstream) users get a compile-time deprecation warning.

Does this PR introduce any user-facing change?

No, test-only.

How was this patch tested?

Locally compiled sql/Test/compile, hive/Test/compile, protobuf/Test/compile, and pipelines/Test/compile successfully. 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 zhengruifeng changed the title [SPARK-55910][SQL][TESTS][FOLLOWUP] Replace SQLTestUtils/SQLTestUtilsBase with QueryTest/QueryTestBase [SPARK-56560][SQL][TESTS] Replace SQLTestUtils/SQLTestUtilsBase with QueryTest/QueryTestBase Apr 21, 2026
…Base with QueryTest/QueryTestBase

Followup to SPARK-55910. Migrate all call sites from the empty alias traits `SQLTestUtils`/`SQLTestUtilsBase` and the `SQLTestUtils.compareAnswers` alias to `QueryTest`/`QueryTestBase` and `QueryTest.compareAnswers` directly, and delete the alias file `sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala`.

Mechanical changes across 68 files:
- `extends/with SQLTestUtils` -> `extends/with QueryTest` (and dropped duplicates when `QueryTest` was already in the parent list)
- `extends/with SQLTestUtilsBase` -> `extends/with QueryTestBase`
- `SQLTestUtils.compareAnswers` -> `QueryTest.compareAnswers`
- Import lines rewritten to `org.apache.spark.sql.{QueryTest,QueryTestBase}` (different package from the old aliases)
- Updated two stale `SQLTestUtils`/`SQLTestUtilsBase` mentions in code comments

Finishes the consolidation started in SPARK-55910 by removing the now-empty alias trait/object and having all test suites reference the canonical `QueryTest`/`QueryTestBase` in `org.apache.spark.sql`.

No, test-only.

Compiled `sql/Test/compile`, `hive/Test/compile`, `protobuf/Test/compile`, and `pipelines/Test/compile` successfully.

Generated-by: Claude Opus 4.7
@zhengruifeng zhengruifeng force-pushed the replace-sqltestutils-with-querytest branch from 5725604 to f130b05 Compare April 21, 2026 13:20
@HyukjinKwon
Copy link
Copy Markdown
Member

Merged to master.

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