GitHub user dosubot[bot] added a comment to the discussion: Superset + 
Opensearch integration

<!-- Answer -->
Superset fails to parse queries with backticks for Opensearch because its 
internal SQL parser (sqlglot) doesn't know how to handle Opensearch-specific 
syntax. The core issue is that Superset does not map the 'odelasticsearch' 
engine to any sqlglot dialect in its SQLGLOT_DIALECTS config—it's commented out 
in the code. As a result, Superset defaults to a generic dialect that doesn't 
recognize backtick-quoted identifiers, causing the parsing error before the 
query ever reaches Opensearch, even though Opensearch itself supports and 
expects backticks for delimited identifiers. This failure happens entirely 
inside Superset's parsing step, not in query construction or in Opensearch 
itself. 

To fix this, Superset would need a dialect mapping for 'odelasticsearch' that 
supports backtick quoting, either by adding it to SQLGLOT_DIALECTS or by 
extending dialects via SQLGLOT_DIALECTS_EXTENSIONS and ensuring the parser 
recognizes backticks for this engine. Until that's done, this parsing error 
will persist for internal queries using backticks, even if those queries are 
valid for Opensearch.  
[Reference: code and 
config](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/sql/parse.py)


<!-- 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/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/af857e4e-f1a7-414d-a6ad-bf4f9478d984?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;[![Sh
 are 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/discussions/34083)

GitHub link: 
https://github.com/apache/superset/discussions/34083#discussioncomment-13681398

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to