dosubot[bot] commented on issue #36939: URL: https://github.com/apache/superset/issues/36939#issuecomment-3717548604
<!-- Answer --> The root cause is that Superset 6.0.0 uses the sqlglot parser to validate and classify all SQL statements before sending them to the database. StarRocks-specific statements like `refresh external table`, `drop table ... FORCE`, and some `show` commands aren't recognized by sqlglot's StarRocks dialect, so Superset blocks them with parsing errors before they ever reach your database—even though they work fine when run directly via SQLAlchemy in Python, which doesn't do this extra parsing or validation [example](https://github.com/apache/superset/issues/36068). There's currently no configuration option to bypass or relax this SQL parsing in SQL Lab. The only reliable workaround is to run unsupported statements directly via SQLAlchemy or another client outside of Superset [example](https://github.com/apache/superset/issues/34984). You could try patching Superset to use a more permissive dialect (like MySQL) for StarRocks, but this is not robust and may break other features [example](https://github.com/apache/superset/issues/36068). The long-term fix is for the StarRocks dialect in sqlglot to add support for these statements. If you want to help, you can contribute to sqlglot or request support for these StarRocks-specific commands upstream. Let me know if you want details on patching the dialect mapping or contributing to sqlglot! <!-- 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/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0c61740c-8693-4d06-abb6-ca81b0d01f04?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=The%20root%20cause%20is%20that%20Superset%206.0.0%20uses%20the%20sqlglot%20parser%20to%20validate%20and%20classify%20all%20SQL%20statements%20before%20sending%20them%20to%20the%20database.%20StarRocks-specific%20statements%20like%20%60refresh%20external%20table%60%2C%20%60drop%20table%20...%20FORCE%60%2C%20and%20some%20%60show%60%20commands%20aren%27t%20recognized%20by%20sqlglot%27s%20StarRocks%20dialect%2C%20so%20Superset%20blocks%20them%20with%20parsing%20errors%20before%20they%20ever%20reach%20your%20database%E2%80%94even%20though%20they%20work%20fine%20when%20run%20directly%20via%20SQLAlchemy%20in%20Python%2C%20which%20doesn%27t%20do%20this%20extra%20parsing%20or%20validation%C2%A0%5Bexample%5D%28https%3A//github.com/apache/superset/issues/3606 8%29.%0A%0AThere%27s%20currently%20no%20configuration%20option%20to%20bypass%20or%20relax%20this%20SQL%20parsing%20in%20SQL%20Lab.%20The%20only%20reliable%20workaround%20is%20to%20run%20unsupported%20statements%20directly%20via%20SQLAlchemy%20or%20another%20client%20outside%20of%20Superset%C2%A0%5Bexample%5D%28https%3A//github.com/apache/superset/issues/34984%29.%20You%20could%20try%20patching%20Superset%20to%20use%20a%20more%20permissive%20dialect%20%28like%20MySQL%29%20for%20StarRocks%2C%20but%20this%20is%20not%20robust%20and%20may%20break%20other%20features%C2%A0%5Bexample%5D%28https%3A//github.com/apache/superset/issues/36068%29.%0A%0AThe%20long-term%20fix%20is%20for%20the%20StarRocks%20dialect%20in%20sqlglot%20to%20add%20support%20for%20these%20statements.%20If%20you%20want%20to%20help%2C%20you%20can%20contribute%20to%20sqlglot%20or%20request%20support%20for%20these%20StarRocks-specific%20commands%20upstream.%0A%0ALet%20me%20know%20if%20you%20want%20details%20on%20patching%20th e%20dialect%20mapping%20or%20contributing%20to%20sqlglot%21) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36939) -- 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]
