You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/08/03 23:06:17 UTC
[PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #42733:
URL: https://github.com/apache/superset/pull/42733
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5225960533
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5224719416
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 3a6e71312298aa98e5ab33c0f44029b97b352477 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a76bd9b15f8970008a6c562 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42733--superset-docs-preview.netlify.app](https://deploy-preview-42733--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#HcvJDYAgEEDRXuYsETUi2IFlAIORRBZZDsbYu8TT_5f3QEzBxQIrQAcqSa-P9gWxtzlXQyY-cEHydZLD-kJ0cM78TanGYoNvDE08w71hg0wuTKFQw7xzsVBKuWR6ZiO8Hw) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-42733--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5273187076
@aminghadersohi appreciate you verifying it locally. Keeping this pinned to the exact StarRocks repro from #38189, happy to leave the other dialects for whoever hits them next.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5224520244
<!-- Bito Reply -->
The current test case in `tests/unit_tests/sql/parse_tests.py` uses a query without a terminating semicolon (`LIMIT 100`). To cover the semicolon form and ensure the issue remains open until the underlying formatting logic is corrected, you can add a second test case or update the existing one to include a semicolon.
Updating the test to include a semicolon would look like this:
```python
sql = """SELECT /*+ SET_VAR(query_timeout = 3000) */ col1, col2
FROM my_table
LIMIT 100;
-- increase timeout for large scans"""
```
This will verify if the formatter correctly handles the semicolon without corrupting the optimizer hint block.
**tests/unit_tests/sql/parse_tests.py**
```
sql = """SELECT /*+ SET_VAR(query_timeout = 3000) */ col1, col2
FROM my_table
LIMIT 100;
-- increase timeout for large scans"""
```
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5225319745
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**Commands**
Type the following command in the pull request comment and save the comment.
- `/review` - Manually triggers a full AI review.
- `/pause` - Pauses automatic reviews on this pull request.
- `/resume` - Resumes automatic reviews.
- `/resolve` - Marks all Bito-posted review comments as resolved.
- `/abort` - Cancels all in-progress reviews.
Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #42733:
URL: https://github.com/apache/superset/pull/42733#discussion_r3740070564
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -938,6 +938,54 @@ 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
+
+-- increase timeout for large scans"""
+ statement = SQLScript(sql, "starrocks").statements[0]
+ formatted = statement.format()
+
+ assert "/*+ SET_VAR(query_timeout = 3000) */" in formatted
+ assert "SET_VAR(query_timeout /*" not in formatted
Review Comment:
**Suggestion:** The oracle is too narrow: it only rejects the exact corruption string `SET_VAR(query_timeout /*`. A formatter can still inject a nested comment elsewhere inside the optimizer hint, or drop/reposition the trailing comment incorrectly, while satisfying both assertions. Assert that the complete hint remains unchanged and that the trailing comment is preserved outside the hint block, applying the same stronger oracle to the semicolon case. [possible bug]
<details>
<summary><b>Severity Level:</b> Minor 🧹</summary>
```mdx
- ⚠️ Regression test can miss lost trailing comments.
- ⚠️ Semicolon corruption oracle remains unnecessarily narrow.
- ⚠️ Execution SQL formatting is insufficiently validated.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=54e11243f20d479bad051dc1b638abbd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=54e11243f20d479bad051dc1b638abbd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/sql/parse_tests.py
**Line:** 958:959
**Comment:**
*Possible Bug: The oracle is too narrow: it only rejects the exact corruption string `SET_VAR(query_timeout /*`. A formatter can still inject a nested comment elsewhere inside the optimizer hint, or drop/reposition the trailing comment incorrectly, while satisfying both assertions. Assert that the complete hint remains unchanged and that the trailing comment is preserved outside the hint block, applying the same stronger oracle to the semicolon case.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42733&comment_hash=a01c00766712d9be966a46f22e7e3c0813d9dc458bc9c53291e580fb8bbb6ce0&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42733&comment_hash=a01c00766712d9be966a46f22e7e3c0813d9dc458bc9c53291e580fb8bbb6ce0&reaction=dislike'>👎</a>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42733:
URL: https://github.com/apache/superset/pull/42733#discussion_r3740356497
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -938,6 +938,54 @@ 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
+
+-- increase timeout for large scans"""
+ statement = SQLScript(sql, "starrocks").statements[0]
+ formatted = statement.format()
+
+ assert "/*+ SET_VAR(query_timeout = 3000) */" in formatted
+ assert "SET_VAR(query_timeout /*" not in formatted
Review Comment:
Good point, tightened the oracle to assert the trailing comment survives outside the hint block rather than just checking for the absence of the corruption string. Applied to both the passing and xfail cases.
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5172678829
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42733:
URL: https://github.com/apache/superset/pull/42733#issuecomment-5172790090
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42733?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 64.76%. Comparing base ([`25ab961`](https://app.codecov.io/gh/apache/superset/commit/25ab96188f1bea54029345ac79f4cc3b05a4d1d4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`bc80bcb`](https://app.codecov.io/gh/apache/superset/commit/bc80bcb39e7b24a8acd8bd789f5d36a06749ffc0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #42733 +/- ##
==========================================
- Coverage 65.57% 64.76% -0.81%
==========================================
Files 2818 2818
Lines 160038 160038
Branches 36557 36557
==========================================
- Hits 104938 103646 -1292
- Misses 53054 54354 +1300
+ Partials 2046 2038 -8
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [hive](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.08% <ø> (ø)` | |
| [mysql](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [postgres](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [presto](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.96% <ø> (ø)` | |
| [python](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.67% <ø> (-1.62%)` | :arrow_down: |
| [sqlite](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.54% <ø> (ø)` | |
| [unit](https://app.codecov.io/gh/apache/superset/pull/42733/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42733?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] test(sql): pin optimizer hint blocks survive format() round-trip (#38189) [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #42733:
URL: https://github.com/apache/superset/pull/42733#discussion_r3739988396
##########
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:
This omits the terminating semicolon that reaches the still-broken relocation branch: with `LIMIT 100;`, this head formats the query as `SET_VAR(query_timeout /* ... */ = 3000)`, reproducing #38189 and yielding invalid StarRocks SQL. Could this cover the semicolon form and keep the issue open until that path is fixed?
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org