Hello Exasol Experts!! Very exciting update to share with you all. The open source library SQLGlot now officially supports Exasol dialect! Check it out here: SQLGlot on GitHub.
This powerful integration enables seamless SQL transpilation between Exasol and all other supported dialects in SQLGlot - like DuckDB, Trino or Spark, Databricks, Snowflake and others. Whether you’re migrating from other databases to Exasol, need to convert Exasol queries for compatibility with other systems, or want to standardize SQL across multiple platforms, this new dialect support makes it possible with just a few lines of code.
Here’s a quick example transpiling a typical TPC-H query from Databricks to Exasol:
import sqlglot
# Exemplary TPC-H query in Databricks
databricks_query = """
SELECT
`l_orderkey`,
SUM(`l_extendedprice` * (1 - `l_discount`)) AS revenue,
`o_orderdate`,
`o_shippriority`
FROM
`customer` `c`
INNER JOIN `orders` `o` ON `c`.`c_custkey` = `o`.`o_custkey`
INNER JOIN `lineitem` `l` ON `l`.`l_orderkey` = `o`.`o_orderkey`
WHERE
`c`.`c_mktsegment` = 'BUILDING'
AND `o`.`o_orderdate` < DATE('1995-03-15')
AND `l`.`l_shipdate` > DATE('1995-03-15')
GROUP BY
`l_orderkey`, `o_orderdate`, `o_shippriority`
ORDER BY
revenue DESC, `o_orderdate`
LIMIT 10
"""
# Transpile to Exasol
exasol_query = sqlglot.transpile(databricks_query, read="databricks", write="exasol")[0]
print(exasol_query)
This will automatically convert Databricks-specific syntax and functions to their Exasol equivalents, handling differences in SQL dialects seamlessly.
There’s so much potential to explore with this integration and we want YOUR feedback!
Please try it out with your SQL workloads and let us know how it performs. Test different query types, edge cases, and real-world scenarios - your experiences will help improve the dialect implementation and identify new opportunities for the community.
This is another step forward in making Exasol more accessible and interoperable within the broader data ecosystem. Your feedback and contributions will help shape how this integration evolves!