feat: add DUCKDB dialect and bidirectional DuckDB converter#229
Open
michellepellon wants to merge 1 commit into
Open
feat: add DUCKDB dialect and bidirectional DuckDB converter#229michellepellon wants to merge 1 commit into
michellepellon wants to merge 1 commit into
Conversation
Adds DUCKDB to the dialect enum (osi-schema.json, spec.yaml, spec.md, Python models), maps it to sqlglot's duckdb dialect for expression validation, and contributes converters/duckdb: a bidirectional Ossie <-> DuckDB converter with CLI, following the hub-and-spoke converter pattern. Works with MotherDuck via md: connection strings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add DUCKDB dialect and a bidirectional DuckDB converter
What
This PR adds DuckDB as a supported expression dialect and contributes a reference converter for it, in three parts:
DUCKDBto theDialectenum incore-spec/osi-schema.json,core-spec/spec.yaml, the dialect table incore-spec/spec.md, and theOSIDialect/OSIVendorenums inpython/src/ossie/models.py.DUCKDBto sqlglot'sduckdbdialect invalidation/validate.py, so DuckDB expressions get full syntax validation (sqlglot's DuckDB support is first-class; no skip-list entry needed).converters/duckdb/, a bidirectional Ossie ↔ DuckDB converter following the hub-and-spoke pattern inconverters/README.md:COMMENT ONfrom descriptions, one view per metric with joins derived from declared relationships). Dialect selection prefersDUCKDB, falls back toANSI_SQLwith a warning.information_schemaandduckdb_constraints()(primary keys, unique keys, and foreign keys → relationships; table/column comments → descriptions).ossie-duckdb export|import), pytest suite with round-trip tests executing generated SQL against in-memory DuckDB, and schema validation of imported models againstosi-schema.json.Why
DuckDB (and MotherDuck, its managed cloud service) is widely used as an analytics engine in lakehouse and embedded-analytics stacks, and is a common substrate for the AI-agent workloads that
ai_contexttargets. Because DuckDB connections are passed through, the converter works against MotherDuck databases (md:connection strings) unchanged.Notes
examples/are untouched and still validate.