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

   <!-- Answer -->
   This error happens because Superset's SQL parsing layer (using sqlglot) 
doesn't currently handle the `ON CLUSTER` clause in ClickHouse DDL. When you 
try to create a Distributed or Replicated table with `ON CLUSTER`, Superset 
encounters an unhandled `sqlglot.expressions.OnCluster` AST node, which leads 
to a generic error (issue code 1002) and blocks dataset creation. Standard 
tables work because they don't use this clause.
   
   Recent updates to sqlglot and Superset's SQL parsing logic have not added 
support for this ClickHouse-specific syntax yet, so this is a current 
limitation of Superset's ClickHouse integration 
[reference](https://github.com/apache/superset/blob/93583220a7aa4debeaf3fd4a6cade9f771ee8c2f/superset/sql/parse.py).
   
   As a workaround, you can create the cluster table directly in ClickHouse 
(outside Superset), then point Superset to the table for dataset 
creation—Superset should be able to read metadata from existing tables, even if 
it can't parse the DDL. If you need Superset to parse and manage DDL with `ON 
CLUSTER`, it would require changes to Superset's SQL parsing and/or sqlglot to 
gracefully handle or ignore the `OnCluster` node.
   
   There are no existing issues or discussions in the repo that address this 
specific problem. If you need to automate DDL creation via Superset, you may 
need to wait for upstream support or consider contributing a patch to handle 
`ON CLUSTER` in the 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/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/69b61071-0ca5-491d-9330-372203be8d9d?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/33838)


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