rusackas commented on code in PR #42733:
URL: https://github.com/apache/superset/pull/42733#discussion_r3740064857
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -938,6 +938,27 @@ def test_sqlscript() -> None:
assert query.get_settings() == {"querytrace": True}
+def test_sqlscript_format_preserves_optimizer_hint_block() -> None:
+ """
+ Regression for #38189: an inline `--` comment trailing a query with a
+ `/*+ SET_VAR(...) */` optimizer hint must not get repositioned inside
+ the hint block during `format()` -- that would corrupt the hint syntax
+ (StarRocks and other engines using the `/*+ ... */` convention reject
+ a nested `/* */` inside it). `format()` is what Superset's execution
+ path actually sends to the engine (see `executor.py`/`celery_task.py`).
+ """
+ sql = """SELECT /*+ SET_VAR(query_timeout = 3000) */ col1, col2
+FROM my_table
+LIMIT 100
Review Comment:
Good catch, confirmed the semicolon form still corrupts the hint block.
Added an `xfail(strict=True)` test pinning that, and reworded the PR body so it
won't auto-close #38189 on merge.
--
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]