Skip to content

Does SQLGlot's data design allow for a MDX dialect? #4937

Closed Answered by georgesittas
galenseilisnh asked this question in Q&A
Discussion options

You must be logged in to vote

You can do many interesting things with SQLGlot, so I don't see why not :)

For example, SQLGlot's execution engine (experimental) leverages the existing dialect infrastructure to transpile SQL to Python and then execute Python code to evaluate queries:

class Python(Dialect):
class Tokenizer(tokens.Tokenizer):
STRING_ESCAPES = ["\\"]
class Generator(generator.Generator):
TRANSFORMS = {
**{klass: _rename for klass in subclasses(exp.__name__, exp.Binary)},
**{klass: _rename for klass in exp.ALL_FUNCTIONS},
exp.Case: _case_sql,
exp.Alias: lambda self, e: self.sql(e.this),

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@galenseilisnh
Comment options

Answer selected by galenseilisnh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants