Skip to content

docs(adr): ADR-0071 dataset semantic-layer depth (multi-hop joins + matrix pivot)#2289

Merged
os-zhuang merged 2 commits into
mainfrom
docs/adr-0071-dataset-depth
Jun 24, 2026
Merged

docs(adr): ADR-0071 dataset semantic-layer depth (multi-hop joins + matrix pivot)#2289
os-zhuang merged 2 commits into
mainfrom
docs/adr-0071-dataset-depth

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

A grounded ADR for the two capability follow-ups from ADR-0021 (the option-2 "semantic-layer depth" direction), based on the current code:

  • Multi-hop joins — today Dataset.include is string[] of single relationship names and qualifyAndRegisterJoin splits on the first dot, so account.owner.region breaks. Proposal: include accepts relationship paths; the compiler expands the join chain; the strategy emits chained LEFT JOINs with per-hop RLS, behind a depth cap (default 3); undeclared paths still rejected (D-C unchanged).
  • Matrix pivotReport.rows/columns already exist but the dataset renderer flattens instead of pivoting (ADR-0021 D2 follow-up). Proposal: DatasetReportRenderer pivots the existing rows/columns into a 2-D grid (query/spec unchanged), with a column-cardinality cap.

Phasing

  • P1 matrix pivot — objectui-only, no spec/query change, ships independently (lowest risk).
  • P2 multi-hop — framework spec + compiler + strategy + per-hop RLS, behind the depth cap; gated by the ADR-0021 reconciliation harness.
  • P3 objectui catalog/UI — multi-hop field picker + include-path editor.

Backward compatible (single-hop + flat rows unchanged). Looking for review on the spec shape (dotted include paths), the depth cap, and the phasing before implementing.

Note: ADR number 0071 picked off latest main (0070); happy to renumber if it collides with a concurrent ADR.

🤖 Generated with Claude Code

…atrix pivot)

Grounded design for the two ADR-0021 follow-ups: multi-hop relationship joins
(include accepts dotted paths; compiler chains; strategy emits chained LEFT JOINs
with per-hop RLS, behind a depth cap) and matrix pivoting (renderer pivots the
existing rows/columns into a 2-D grid; query/spec unchanged). Phased P1 (matrix,
objectui-only) → P2 (multi-hop framework) → P3 (objectui catalog/UI).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 24, 2026 2:54pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels Jun 24, 2026
Bake in the expert refinements: restrict multi-hop to to-one relationships
(lookup/master_detail) so chains never fan out and SUM stays correct with no
symmetric-aggregate machinery; to-many rollups explicitly out of scope. Add a
Prior art section (Salesforce report types, Looker Explores, Power BI/Tableau
relationships, Cube transitive joins; the Looker/Tableau fan-out lesson). Note
dotted paths are self-disambiguating; depth cap is now a perf guard not a
correctness one; matrix column cap is a display ceiling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit cb24f46 into main Jun 24, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the docs/adr-0071-dataset-depth branch June 24, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant