[SPARK-56619][SQL][TESTS] Add DSv2 repeated table access tests with internal/external changes #55462
Open
longvu-db wants to merge 14 commits intoapache:masterfrom
Open
[SPARK-56619][SQL][TESTS] Add DSv2 repeated table access tests with internal/external changes #55462longvu-db wants to merge 14 commits intoapache:masterfrom
longvu-db wants to merge 14 commits intoapache:masterfrom
Conversation
77c6144 to
242bdaa
Compare
Co-authored-by: Isaac
… external changes Remove production code changes (DataFrameWriter, DataFrameWriterV2), InMemoryBaseTable column-drop handling, CachingInMemoryTableCatalog, NullIdInMemoryTableCatalog, Edge.7 test, and caching tests. Keep 6 tests: session/external variants of write, schema change, and drop/recreate scenarios. Co-authored-by: Isaac
Co-authored-by: Isaac
…l writes Replace separate suite and SharedInMemoryTableCatalog with direct catalog API calls (loadTable with write privileges, alterTable, dropTable/createTable) matching the pattern in the CACHE TABLE tests. Co-authored-by: Isaac
…eCatalog Adds 3 tests verifying that when a DSv2 connector caches table state, external changes are invisible through repeated sql() calls. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
…ests After asserting stale data with the caching connector, REFRESH TABLE invalidates the connector cache and verifies external changes become visible. Also adds invalidateTable override to CachingInMemoryTableCatalog. Co-authored-by: Isaac
…ng tests Move each cache test next to its corresponding external test with matching section numbers. Also adds invalidateTable override to CachingInMemoryTableCatalog for REFRESH TABLE support. Co-authored-by: Isaac
Co-authored-by: Isaac
4b5c3a5 to
489e519
Compare
…pr2-repeated-sql # Conflicts: # sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala
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?
Add 6 tests to
DataSourceV2DataFrameSuitethat verify DSv2 tables reflect the latest state when accessed repeatedly viasql()(without CACHE TABLE). Eachsql("SELECT * FROM t")call creates a freshQueryExecution, so it always sees the most recent data, schema, and table identity.The tests cover three scenarios, each with a session-write and an external-write variant:
sql()query sees the new data.sql()query reflects the updated schema.sql()query sees the empty recreated table.External writes use direct catalog API calls (
loadTablewith write privileges,alterTable,dropTable/createTable), matching the pattern used by the existing CACHE TABLE tests in the same suite.Why are the changes needed?
These tests document and lock down the expected behavior: repeated
sql()access without CACHE TABLE always sees the latest table state. This prevents regressions if internal resolution or caching logic changes.Does this PR introduce any user-facing change?
No. This PR is test-only.
How was this patch tested?
6 new tests in
DataSourceV2DataFrameSuite, all passing:Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-6)