You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-59362][SQL] Extract the duplicated TableProvider resolution block in ResolveDataSource
### What changes were proposed in this pull request?
`ResolveDataSource` contained an identical ~25-line `TableProvider` resolution block in two `resolveOperatorsUp` cases -- the `NamedStreamingRelation`-wrapped case and the no-name streaming `UnresolvedDataSource` case. This extracts that block into a single private helper, `resolveV2StreamingRelation`, and calls it from both sites.
The helper builds a `StreamingRelationV2` when the provider's table supports micro-batch or continuous reads, and otherwise falls back to a v1 `StreamingRelation` -- exactly as the inline code did.
### Why are the changes needed?
The two blocks were byte-for-byte identical; extracting them keeps the v2-provider streaming-resolution logic in one place. Behavior is unchanged -- the helper body is the original code verbatim, and both call sites pass the same values.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests; `build/sbt sql/compile` passes. This is a behavior-preserving refactor (verbatim extraction of an identical block).
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8)
Closes#58653 from uros-b/dedup-resolve-datasource-block.
Authored-by: Uros <221401595+uros-b@users.noreply.github.com>
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>
0 commit comments