Repository navigation
Conversation
ericm-db
marked this pull request as ready for review
October 15, 2026 21:19
Wrap all streaming table reads consistently with Classic so unnamed sources reach the analyzer's source-evolution validation. Add planner enforcement and shared Python parity regressions. Co-authored-by: Isaac <no-reply@databricks.com>
funrollloops
approved these changes
Oct 16, 2026
| // Options for the named table. The map key is case insensitive. | ||
| map<string, string> options = 2; | ||
|
|
||
| optional string source_name = 3; |
Contributor
There was a problem hiding this comment.
It's unfortunate this isn't alongside is_streaming, but this is the best option now.
Retain named streaming relation wrappers through catalog resolution so source enforcement and feature gating run. Reset terminated-query state in the regression test and restore Scala import ordering. Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
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?
Preserve
DataStreamReader.name(...).table(...)source names in the Python and Scala Spark Connect clients and server:Read.NamedTable.source_name = 3and regenerate the Python protobuf bindings.NamedStreamingRelation, matching Classic. Unnamed tables retainUnassignedso source-evolution enforcement can reject them.load()path unchanged. Unnamed streaming table reads still work when source evolution is disabled.Classic already propagates table source names, so it needs no production change. A shared Python regression covers both Classic and Connect. CDC
changes()is outside this patch's scope.Why are the changes needed?
Connect currently serializes named and unnamed streaming table reads identically. The server cannot recover the missing name for source-evolution validation or checkpoint source IDs.
For example, with an existing parquet table and source evolution disabled:
Classic rejects the explicit name with
STREAMING_QUERY_EVOLUTION_ERROR.SOURCE_NAMING_NOT_SUPPORTED. Connect loses the name instead. With source evolution enabled, the table read must retainorders_sourcein its checkpoint rather than becoming an unnamed source.Does this PR introduce any user-facing change?
Yes. Spark Connect streaming table reads now honor the existing experimental
.name()API, including its validation and feature-gate errors, matching Classic. With source evolution enabled, unnamed table reads also fail with the intended analysis error instead of bypassing source-naming enforcement.The protocol addition is optional and wire-compatible. Both a fixed client and a fixed server are required: an older server accepts but ignores the unknown field, so upgrading only the client is insufficient. No new public method is added.
How was this patch tested?
Passed locally:
pyspark.sql.tests.connect.test_connect_plan, including the new named/unnamed table serialization regression.NamedTable.source_name = 3; an old-schema round trip accepts and preserves the unknown field but cannot apply its name.git diff --check.Added, but not run locally:
ClientStreamingQuerySuite.SparkConnectPlannerSuite, including unnamed-source enforcement throughNameStreamingSources.availableNowtrigger, a fresh checkpoint, bounded termination and cleanup. It checks the V2 offset log containsorders_source:, verifies unnamed reads are rejected when enforcement is enabled, and covers both named/unnamed behavior when it is disabled.The JVM-backed suites require building the changed server/client and remain unverified locally. No existing worktree's build outputs were reused and no broad shared build was started.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex CLI 0.156.0