Skip to content

[SPARK-56643][SPARK-56619][CONNECT][SQL][TESTS] Share DSv2 test cases…#56047

Open
longvu-db wants to merge 1 commit into
apache:masterfrom
longvu-db:dsv2-shared-test-traits
Open

[SPARK-56643][SPARK-56619][CONNECT][SQL][TESTS] Share DSv2 test cases…#56047
longvu-db wants to merge 1 commit into
apache:masterfrom
longvu-db:dsv2-shared-test-traits

Conversation

@longvu-db
Copy link
Copy Markdown
Contributor

… between classic and connect

Refactors DSv2 test organization to eliminate duplication between classic and Connect mode tests. Introduces shared test traits that define test scenarios once and run them in both modes.

New shared traits in sql/core (accessible from both sql/core and sql/connect):

  • DSv2ExternalMutationTestBase: base trait with 5 abstract methods (withTestSession, checkRows, getTableCatalog, withTestTableAndViews, testPrefix) and shared externalAppend helper
  • DSv2TempViewWithStoredPlanTests: 21 temp view tests (7 scenarios x 3 variants)
  • DSv2RepeatedSQLTests: 9 repeated sql() access tests (3 scenarios x 3 variants)

Classic suite (DataSourceV2DataFrameSuite):

  • Mixes in DSv2TempViewWithStoredPlanTests and DSv2RepeatedSQLTests
  • Implements abstract methods using classic session, checkAnswer, catalog()
  • Removes 578 lines of inline test code

Connect suites (thin wrappers):

  • DataSourceV2TempViewConnectSuite (72 lines vs 739 previously)
  • DataSourceV2RepeatedSQLConnectSuite (144 lines, includes 3 connect-specific "reused DataFrame" tests)

Co-authored-by: Isaac

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

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

… between classic and connect

Refactors DSv2 test organization to eliminate duplication between classic
and Connect mode tests. Introduces shared test traits that define test
scenarios once and run them in both modes.

New shared traits in sql/core (accessible from both sql/core and sql/connect):
- DSv2ExternalMutationTestBase: base trait with 5 abstract methods
  (withTestSession, checkRows, getTableCatalog, withTestTableAndViews, testPrefix)
  and shared externalAppend helper
- DSv2TempViewWithStoredPlanTests: 21 temp view tests (7 scenarios x 3 variants)
- DSv2RepeatedSQLTests: 9 repeated sql() access tests (3 scenarios x 3 variants)

Classic suite (DataSourceV2DataFrameSuite):
- Mixes in DSv2TempViewWithStoredPlanTests and DSv2RepeatedSQLTests
- Implements abstract methods using classic session, checkAnswer, catalog()
- Removes 578 lines of inline test code

Connect suites (thin wrappers):
- DataSourceV2TempViewConnectSuite (72 lines vs 739 previously)
- DataSourceV2RepeatedSQLConnectSuite (144 lines, includes 3 connect-specific
  "reused DataFrame" tests)

Co-authored-by: Isaac
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.

1 participant