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

   <!-- Answer -->
   The reason your SQL works in clickhouse-client but fails in Superset is that 
Superset uses the sqlglot library to parse SQL, and sqlglot currently doesn't 
support the ON CLUSTER clause. Superset passes your SQL to the driver, and if 
sqlglot can't parse a clause, you'll get errors like the one you saw. There 
isn't any special handling for ON CLUSTER in Superset's ClickHouse 
integration—unsupported syntax just results in errors surfaced to the user 
[cite](https://github.com/apache/superset/blob/a1cbd2578e24ed6c72024e1d1cf195846ace05d7/superset/db_engine_specs/clickhouse.py).
   
   Workarounds discussed in the community include: running DDL like CREATE 
TABLE ... ON CLUSTER directly in ClickHouse (not through Superset), creating a 
view in ClickHouse that encapsulates your logic and querying that from 
Superset, or extending sqlglot to support the clause (which requires Python 
development) [cite](https://github.com/apache/superset/discussions/32345). 
   
   If you need to run this kind of DDL from Superset, there isn't a built-in 
workaround—it's a limitation of the current SQL parsing layer.
   
   
   <!-- 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/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/e2f5fc22-ccdf-4210-90c2-6515ce54da9b?feedback_type=other)</sup>&nbsp;&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/33813)


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