[SPARK-55910][SQL][TESTS] Merge SQLTestUtils into QueryTest#55269
Draft
zhengruifeng wants to merge 15 commits intoapache:masterfrom
Draft
[SPARK-55910][SQL][TESTS] Merge SQLTestUtils into QueryTest#55269zhengruifeng wants to merge 15 commits intoapache:masterfrom
SQLTestUtils into QueryTest#55269zhengruifeng wants to merge 15 commits intoapache:masterfrom
Conversation
Co-authored-by: Isaac
Move waitForTasksToFinish, withTempPaths, getCurrentClassCallSitePattern, and getNextLineCallSitePattern into QueryTestBase since they don't depend on AnyFunSuite. Co-authored-by: Isaac
Remove the override that narrowed spark to classic.SparkSession. Cast to classic.SparkSession only where needed: testImplicits, stripSparkFilter, and logicalPlanToSparkQuery. Co-authored-by: Isaac
…alias QueryTestBase now extends SQLTestData directly, so setupTestData/ loadTestData logic moves into QueryTest. SQLTestUtils and SQLTestUtilsBase become truly empty aliases with no additional members. Co-authored-by: Isaac
Co-authored-by: Isaac
QueryTestBase already declares self: Suite, so SQLTestUtilsBase inherits the constraint. Co-authored-by: Isaac
After removing testImplicits from QueryTestBase, it needs to be defined in the session-providing traits instead. Co-authored-by: Isaac
…stHiveSingleton Co-authored-by: Isaac
Co-authored-by: Isaac
Move SparkFunSuite-dependent methods (test overrides, withTempDir, setupTestData, etc.) back to SQLTestUtils to avoid class hierarchy conflicts. QueryTest class becomes a minimal SparkFunSuite + QueryTestBase + PlanTest combination. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
These don't depend on AnyFunSuite — they only use BeforeAndAfterAll and SQLTestData, both already in QueryTestBase. Co-authored-by: Isaac
Methods like withTempDir, testQuietly, testWithWholeStageCodegenOnAndOff need SparkFunSuite and are used by suites that extend SQLTestUtils (via SharedSparkSession) without extending QueryTest. Keep them in SQLTestUtils; QueryTest class remains minimal. Co-authored-by: Isaac
SQLTestUtils body is now empty. Methods like withTempDir, testQuietly, testWithWholeStageCodegenOnAndOff are in QueryTest. SparkPlanTest, PlannerSuite, and HDFSMetadataLogSuite updated to extend QueryTest. Co-authored-by: Isaac
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?
Merge
SQLTestUtils/SQLTestUtilsBaseutility methods intoQueryTest/QueryTestBase, makingSQLTestUtilsa thin alias ofQueryTest.Before:
QueryTestandSQLTestUtilswere independent — test suites had to mix in both.After:
All utility methods (
withTable,withView,withSQLConf,checkAnswer,testImplicits, etc.) now live inQueryTest/QueryTestBase.SQLTestUtilsretains only 3 members forSQLTestDataloading (setupTestData,loadTestDataBeforeTests,beforeAll).Why are the changes needed?
SQLTestUtilsandQueryTestserved complementary roles (test infrastructure vs query validation) but were always used together. Merging them intoQueryTestreduces the number of traits test suites need to mix in and simplifies the test class hierarchy.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Existing tests. This is a pure refactor — all methods are moved as-is with no behavioral changes.
SQLTestUtilsandSQLTestUtilsBaseremain as backward-compatible aliases.Was this patch authored or co-authored using generative AI tooling?
Co-authored-by: Claude code (Opus 4.6)