Repository navigation
Add transactional DuckDB definitions and native PEG support - #405
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a821fcc4fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let cte_name = self.quote_identifier(&self.model_alias(model_name)); | ||
| cte_defs.push(format!( | ||
| "{model_name}_cte AS (\n {cte_select}\n FROM {cte_source}{cte_where}\n)" | ||
| "{cte_name} AS (\n {cte_select}\n FROM {cte_source}{cte_where}\n)" |
There was a problem hiding this comment.
Quote every reference to the newly quoted CTE aliases
When generating PostgreSQL or Redshift SQL for a model whose name contains uppercase characters, this now declares a case-sensitive CTE such as "Orders_cte", but derived/ratio metric expansion still emits unquoted references through simple_metric_reference_sql (for example, Orders_cte.revenue_raw). Those references are folded to lowercase and fail to resolve against the quoted CTE. Apply quote_identifier consistently to aliases in all metric-expansion and filter paths before changing the declaration to a quoted identifier.
Useful? React with 👍 / 👎.
Make semantic definitions transactional and durable in DuckDB, with rollback, connection isolation, prepared execution, and migration from existing sidecars. Route definition imports through DuckDB's filesystem controls and preserve literal YAML values. Fix aliases and quoted-name routing, retain semantic errors, and reuse Rust parser workers without holding the registry lock during compilation.
Target DuckDB 1.5.6 for stable builds and add native PEG grammar for pinned 2.x. Rewrite semantic sources inside views, CREATE TABLE AS, and INSERT SELECT while preserving DuckDB's statement behavior, including parameters, RETURNING, EXPLAIN, and transactions. Views retain their compiled definition across restart and later metric changes.
Cover both versions in CI, including catalog lifecycle, parser coexistence, file permissions, SQL containers, and advanced metric execution. Retention uses structured compilation because its result is a table. Packaged shells that preload autocomplete require the SEMANTIC prefix because of DuckDB's parser ordering.