docs: add MDL reference docs for Model, Relationship, and View#1446
docs: add MDL reference docs for Model, Relationship, and View#1446douenergy merged 1 commit intoCanner:mainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThree new documentation files are introduced describing MDL features: Model (comprehensive overview of structure, fields, and internals), Relationship (join paths between models with validation and resolution details), and View (named SQL queries with schema inference and query expansion behavior). Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/mdl/model.md (2)
407-419: Add language specifier to fenced code block.The code block at line 407 should specify a language (or
text) for proper syntax highlighting and markdown linting compliance.📝 Suggested fix
-``` +```text Column definition │ ├── is_hidden: true → stripped from symbol table; invisible to all clientsAs per coding guidelines, static analysis tool markdownlint-cli2 flagged this as MD040 (fenced-code-language).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/mdl/model.md` around lines 407 - 419, The fenced code block that begins with "Column definition" lacks a language specifier, causing markdownlint MD040; update the opening fence for that block (the triple-backtick preceding the "Column definition" text) to include a language token such as "text" (e.g., change ``` to ```text) so the block is explicitly marked and syntax highlighting/linting passes.
187-187: Add language specifier to fenced code block.The code block at line 187 should specify a language for proper syntax highlighting and markdown linting compliance.
📝 Suggested fix
-``` +```text raw_orders ──► stg_orders ──► orders raw_customers ──► stg_customers ──► customers raw_payments ──► stg_payments</details> As per coding guidelines, static analysis tool markdownlint-cli2 flagged this as MD040 (fenced-code-language). <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@docs/mdl/model.mdat line 187, The fenced code block containing the diagram
lines "raw_orders ──► stg_orders ──► orders" etc. lacks a language specifier;
update that fenced block to include a language (e.g., add "text" after the
opening triple backticks so it becomes ```text) to satisfy markdownlint MD040
and enable proper syntax highlighting for that block.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Inline comments:
In@docs/mdl/relationship.md:
- Line 155: The docs incorrectly state that relation_chain builds a LEFT JOIN;
update the sentence in docs/mdl/relationship.md to state that relation_chain
resolves the join path using a RIGHT JOIN (matching the implementation in
relation_chain.rs); reference the implementation which uses
LogicalPlanBuilder::join_on with datafusion::logical_expr::JoinType::Right so
the documentation and the code (relation_chain) remain consistent.
Nitpick comments:
In@docs/mdl/model.md:
- Around line 407-419: The fenced code block that begins with "Column
definition" lacks a language specifier, causing markdownlint MD040; update the
opening fence for that block (the triple-backtick preceding the "Column
definition" text) to include a language token such as "text" (e.g., changetotext) so the block is explicitly marked and syntax highlighting/linting
passes.- Line 187: The fenced code block containing the diagram lines "raw_orders ──►
stg_orders ──► orders" etc. lacks a language specifier; update that fenced block
to include a language (e.g., add "text" after the opening triple backticks so it
becomes ```text) to satisfy markdownlint MD040 and enable proper syntax
highlighting for that block.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: defaults **Review profile**: CHILL **Plan**: Pro **Run ID**: `6feee006-96d9-4dee-b330-24026d824341` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between fc1c54b1112b4ba22349d2375abc864cfb9b0900 and 49e7dd6cf043d7d0cfa87b45471f582fa6384c04. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `docs/mdl/model.md` * `docs/mdl/relationship.md` * `docs/mdl/view.md` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
…r#1446) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
docs/mdl/model.md— full reference for Model fields, data source options (table_reference,ref_sql,base_object), column types (regular, calculated, relationship), column-level access control via selective exposure, and engine internals (physical schema registration,is_hidden, expression resolution)docs/mdl/relationship.md— reference for Relationship fields, join types, condition syntax, usage in queries and calculated columns, and engine internals (resolution pipeline,TO_MANYaggregate subqueries)docs/mdl/view.md— reference for View fields, Model vs View comparison, jaffle_shop examples, and engine internals (ExpandWrenViewRule, session registration, recursive expansion)All three docs use the jaffle_shop dataset for consistent examples throughout.
Test plan
./relationship.md,./model.md) resolve correctly🤖 Generated with Claude Code
Summary by CodeRabbit