codeant-ai-for-open-source[bot] commented on code in PR #41279:
URL: https://github.com/apache/superset/pull/41279#discussion_r3721053917
##########
superset-frontend/src/explore/components/controls/FilterControl/utils/translateToSQL.ts:
##########
@@ -44,6 +44,7 @@ export const OPERATORS_TO_SQL = {
'IS NULL': 'IS NULL',
'IS TRUE': 'IS TRUE',
'IS FALSE': 'IS FALSE',
+ CONTAINS: 'CONTAINS',
Review Comment:
**Suggestion:** The generated SQL for `CONTAINS` is not valid ClickHouse
SQL: switching an array filter from the simple editor to the SQL editor
produces `column CONTAINS value`, and saving it changes the filter to a raw SQL
expression, bypassing the backend engine-spec implementation that should
generate `has(column, value)`. Translate this operation to the dialect-aware
expression or prevent it from being emitted as raw SQL. [api mismatch]
<details>
<summary><b>Severity Level:</b> Major ⚠️</summary>
```mdx
- ❌ ClickHouse array filters fail after SQL-editor conversion.
- ⚠️ SQL editor bypasses dialect-aware array membership handling.
- ⚠️ Saved Explore charts retain invalid filter expressions.
```
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d170700b83ae41299504a29f47ee5bde&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=d170700b83ae41299504a29f47ee5bde&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:**
superset-frontend/src/explore/components/controls/FilterControl/utils/translateToSQL.ts
**Line:** 47:47
**Comment:**
*Api Mismatch: The generated SQL for `CONTAINS` is not valid ClickHouse
SQL: switching an array filter from the simple editor to the SQL editor
produces `column CONTAINS value`, and saving it changes the filter to a raw SQL
expression, bypassing the backend engine-spec implementation that should
generate `has(column, value)`. Translate this operation to the dialect-aware
expression or prevent it from being emitted as raw SQL.
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%2F41279&comment_hash=d8d1f0920bb9b0b2a61cce2f9fc0af4af5043c6aa5fbec1b1c334b410fbc91e6&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41279&comment_hash=d8d1f0920bb9b0b2a61cce2f9fc0af4af5043c6aa5fbec1b1c334b410fbc91e6&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: [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]