Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <david.milicevic@databricks.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
- Loading branch information