Commit 1c05874
committed
[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>
(cherry picked from commit 62c57b4)
Signed-off-by: Uros Bojanic <221401595+uros-b@users.noreply.github.com>1 parent 4995709 commit 1c05874
1 file changed
Lines changed: 42 additions & 50 deletions
Lines changed: 42 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 96 | + | |
| 97 | + | |
121 | 98 | | |
122 | 99 | | |
123 | 100 | | |
| |||
154 | 131 | | |
155 | 132 | | |
156 | 133 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 134 | + | |
| 135 | + | |
182 | 136 | | |
183 | 137 | | |
184 | 138 | | |
| |||
187 | 141 | | |
188 | 142 | | |
189 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
190 | 182 | | |
191 | 183 | | |
192 | 184 | | |
| |||
0 commit comments