dosubot[bot] commented on issue #37285:
URL: https://github.com/apache/superset/issues/37285#issuecomment-3773404787

   <!-- Greeting -->
   Hi @kfrydel! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   This issue happens because Superset relies on SQLGlot for SQL parsing, and 
the ClickHouse dialect in SQLGlot does not support the 
nested/double-parentheses syntax used by aggregate functions like 
`groupConcat(', ')(part_name)`. Superset does not add any custom handling for 
this syntax and simply passes your query to SQLGlot, which then fails to parse 
it, resulting in the error you see in SQL Lab—even though the query works in 
the native ClickHouse client. This is a known limitation of the SQL parsing 
layer in Superset for ClickHouse connections 
([source](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/sql/parse.py#L57-L575)).
   
   There is no documented workaround or configuration option in Superset to 
bypass this parser limitation. If possible, try rewriting your query to avoid 
the double-parentheses syntax, or use alternative ClickHouse functions that do 
not require this form. If your use case requires this exact syntax, you may 
need to run such queries directly in the ClickHouse client or wait for improved 
support in SQLGlot and Superset.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/3f02828f-b3ee-41ef-9387-66403afe1fc3?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20issue%20happens%20because%20Superset%20relies%20on%20SQLGlot%20for%20SQL%20parsing%2C%20and%20the%20ClickHouse%20dialect%20in%20SQLGlot%20does%20not%20support%20the%20nested/double-parentheses%20syntax%20used%20by%20aggregate%20functions%20like%20%60groupConcat%28%27%2C%20%27%29%28part_name%29%60.%20Superset%20does%20not%20add%20any%20custom%20handling%20for%20this%20syntax%20and%20simply%20passes%20your%20query%20to%20SQLGlot%2C%20which%20then%20fails%20to%20parse%20it%2C%20resulting%20in%20the%20error%20you%20see%20in%20SQL%20Lab%E2%80%94even%20though%20the%20query%20works%20in%20the%20native%20ClickHouse%20client.%20This%20is%20a%20known%20limitation%20of%20the%20SQL%20parsing%20layer%20in%20Superset%20for%20ClickHouse%20connections%C2%A0
 
%28%5Bsource%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/sql/parse.py%23L57-L575%29%29.%0A%0AThere%20is%20no%20documented%20workaround%20or%20configuration%20option%20in%20Superset%20to%20bypass%20this%20parser%20limitation.%20If%20possible%2C%20try%20rewriting%20your%20query%20to%20avoid%20the%20double-parentheses%20syntax%2C%20or%20use%20alternative%20ClickHouse%20functions%20that%20do%20not%20require%20this%20form.%20If%20your%20use%20case%20requires%20this%20exact%20syntax%2C%20you%20may%20need%20to%20run%20such%20queries%20directly%20in%20the%20ClickHouse%20client%20or%20wait%20for%20improved%20support%20in%20SQLGlot%20and%20Superset.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https
 %3A//github.com/apache/superset/issues/37285)


-- 
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]

Reply via email to