Commit c159033
[SPARK-48376][SQL][FOLLOWUP] Add ITERATE statement fixes
### What changes were proposed in this pull request?
Previous [pull request](#47973) introduced new logic for `LEAVE` and `ITERATE` statements, but I missed to introduce minor part of `ITERATE` statement handling.
While `ITERATE` statement is not allowed for compounds (i.e. user cannot use `LEAVE <label>` where label belongs to compound) it's still possible to use `ITERATE` statement within the compound (i.e. when using label of the surrounding `WHILE` loop for example). In such cases, it's required to drop variables defined in the compound (the same way as for `ITERATE` statement).
We don't yet have execution logic (I will work on POC and design doc during the next week), but this is setting up stuff now, so we don't miss anything in future.
### Why are the changes needed?
Changes are minor, they improve consistency among test suites for SQL scripting.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Added small test, but not completely related to this change. Since we don't have execution logic yet, it's hard to test. I will add more tests together with the execution logic.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #48022 from davidm-db/missing_logic_for_leave_statement.
Authored-by: David Milicevic <[email protected]>
Signed-off-by: Max Gekk <[email protected]>1 parent 2912964 commit c159033
File tree
2 files changed
+59
-1
lines changed- sql/core/src
- main/scala/org/apache/spark/sql/scripting
- test/scala/org/apache/spark/sql/scripting
2 files changed
+59
-1
lines changedLines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
| |||
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
| |||
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
209 | | - | |
| 216 | + | |
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
215 | 222 | | |
| 223 | + | |
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
221 | 245 | | |
222 | 246 | | |
223 | 247 | | |
| |||
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
681 | 715 | | |
0 commit comments