Does SQLGlot's data design allow for a MDX dialect? #4937
-
I decided not to post this as a feature request b/c MDX isn't really a SQL dialect. I am fine with the idea that SQLGlot only supports SQL dialects. It would be helpful if it did allow some further cross-lang support since transpiling from MDX-to-SQL could be helpful. But I expect supporting cross-language transpiling gets more difficult as different technologies support non-equivalent concepts. I am thinking about tokenizing and parsing MDX. I started a prototype in pure Python, but the thought occurred to me that 'maybe' SQLGlot could do it via defining an MDX dialect file similar to the ones defined within SQLGlot.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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: sqlglot/sqlglot/executor/python.py Lines 420 to 460 in 09882e3 I'm not familiar with MDX, but you could certainly play around with it. The degree of convergence from usual SQL syntax is what determines whether it's recommended. I'm also not familiar of alternatives. |
Beta Was this translation helpful? Give feedback.
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:
sqlglot/sqlglot/executor/python.py
Lines 420 to 460 in 09882e3