-
Notifications
You must be signed in to change notification settings - Fork 338
Description
I am running queries against a DuckDB instance over a PostgreSQL-compatible connection (setting default dialect to duckdb for all models, of course). For whatever reason, both SQLGlot/SQLMesh are very confused by this setup and my queries are constantly being mangled. For example SELECT map_from_entries(list_filter(map_entries(_props), pair -> LEFT(pair.key, 1) != '$')) AS foo becomes literally SELECT AS foo because SQLglot converts map_from_entries into exp.MapFromEntries which I suppose is not supported on DuckDB so is transpiled to ''?
Anyway - this is a terrible experience. I have wasted a ton of time trying to reverse engineer what will work. I frankly don't need this super sophisticated parsing & transpilation the majority of the time. I know exactly what I want to write and it is indeed syntactically correct. I just need SQLMesh / SQLGlot to stay out of my way. Is there any possibility to "shell out" as it were and write my own SQL?
Note that Python fetchdf is not an option due to dataset size, and Python SQL is similarly mangled.