rusackas opened a new pull request, #42733: URL: https://github.com/apache/superset/pull/42733
### SUMMARY Regression test for #38189, which reported that Superset's SQL parser injects a repositioned `--` comment inside a `/*+ SET_VAR(...) */` optimizer hint block, producing invalid SQL for StarRocks/MySQL-style engines that use the `/*+ ... */` hint convention. This doesn't reproduce against the actual execution-time code path: `SQLStatement.format()`, the same method `superset/sql/execution/executor.py` and `superset/sql/execution/celery_task.py` call to build the SQL that's actually sent to the engine. With the currently pinned `sqlglot` 30.12.0, the trailing `--` comment is repositioned safely after the statement, not injected inside the hint block. Passes on current `master` — closes #38189 as already fixed (likely by a `sqlglot` version bump since the report; exact version isn't pinned down here since it's not needed to confirm the current state). ### TESTING INSTRUCTIONS ``` pytest tests/unit_tests/sql/parse_tests.py -k test_sqlscript_format_preserves_optimizer_hint_block ``` ### ADDITIONAL INFORMATION - [x] Has associated issue: #38189 - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
