[SPARK-56505][SQL][TESTS] SharedSparkSession provides sql.SparkSession, add SharedClassicSparkSession, ClassicQueryTest#55356
Draft
fwc wants to merge 35 commits into
Draft
Conversation
Contributor
|
@fwc We are going to merge SQLTestUtils into QueryTest, and then make SQLTestUtils just a alias to QueryTest. |
| * Use this trait to indicate that this test is classic-only, i.e. it would not make sense to run | ||
| * this test with a [[org.apache.spark.sql.connect.SparkSession]]. | ||
| */ | ||
| trait SharedClassicSparkSession extends SharedSparkSession with ClassicSQLTestUtils { |
Contributor
There was a problem hiding this comment.
I am wondering should it just maxin with a trait like ClassicSparkSessionProvider
c86f3b7 to
6f9618e
Compare
29c0a9a to
d4ae708
Compare
The sql.DatasetHolder will be used by the SQLTestUtils.testImplicits instead of the classic.DatasetHolder, which will be used in ClassicSQLTestUtils.classicTestImplicts.
I think too many tests rely on this to move it to ClassicSQLTestUtils. I guess we'd need some (test-only?!) extension to connect to make this work.
I think too many tests rely on this to move it to ClassicSQLTestUtils. I guess we'd need some (test-only?!) extension to connect to make this work.
Does this block?! If not: test-only connect extension?
…super super (i.e. SharedSparkSession) will only provide sql.SparkSession. I think there'd be a way to not require the cast when SharedClassicSparkSession extends initialization logic. I'm kinda unsure what is more hacky.
This reverts commit 693cf61.
…flict resolution Seven files had upstream additions (PATH tests, Changelog CDC tests, NullIf tests, null-aware anti join test, etc.) accidentally dropped when the rebase used `git checkout --theirs` to resolve conflicts. Restore master content and re-apply only the SharedClassicSparkSession / classicTestImplicits changes. Co-authored-by: Isaac
SQLTestUtils was merged into QueryTest upstream, so this trait should extend and be named after QueryTest, not the deprecated alias. Co-authored-by: Isaac
Mechanical rename across all call sites. Co-authored-by: Isaac
Move the definition from SQLTestUtils.scala to a new file at org.apache.spark.sql.test.classic.QueryTest. The 'classic' qualifier now lives in the package name rather than the class name. Co-authored-by: Isaac
Update all import sites from org.apache.spark.sql.test.ClassicQueryTest
to org.apache.spark.sql.test.classic.{QueryTest => ClassicQueryTest}.
Co-authored-by: Isaac
6cd4c69 to
8bf1800
Compare
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?
The PR adds
SharedClassicSparkSessionandClassicSQLTestUtilshelpers that provide/useclassic.SparkSessionand then changesSharedSparkSessionto provide only an abstractsql.SparkSession.The PR is split in the following sections:
ClassicSQLTestUtilsandSharedClassicSparkSessionSQLTestUtilsandSharedSparkSessionwith theirClassic-subtraits wherever neededClassic-subtraits, only provide abstract session inSharedSparkSessionWhy are the changes needed?
For historical reasons, many tests use
SharedSparkSession, even though they do not necessarily are strictly classic-only.This change "lifts"
SharedSparkSessionto be more abstract, so that potentially some test traits/classes could be extend in such a way that aconnect.SparkSessionis supplied.The added
SharedClassicSparkSessionandClassicSQLTestUtilsprovide the needed helpers for classic-only suites.Does this PR introduce any user-facing change?
No. This is test-only and mostly type-level.
How was this patch tested?
Existing tests.
Was this patch authored or co-authored using generative AI tooling?
The initial patch was 'hand-written'. The patch was then rebased onto the 'SQLTestUtils merged into QueryTest' changes via claude code.