You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL DDL is under-modeled: CREATE TABLE/VIEW become generic Variable nodes with no lineage #574
SQL DDL is under-modeled. CREATE TABLE / CREATE VIEW are extracted but labeled generic Variable, CREATE MATERIALIZED VIEW is dropped, and there is no table-to-table lineage. Every CREATE collapses to an untyped Variable node with zero lineage edges, so the graph cannot answer basic questions:
"What tables/views does this view read from?"
"What breaks downstream if I change this table?"
Public test bed: lerocha/chinook-database (pure CREATE TABLE / CREATE VIEW DDL).
Proposed solution
Label create_table as Table, and create_view / create_materialized_view as View.
Emit FROM/JOIN relation references as USAGE lineage edges, resolved through the existing definition registry, so a view links to the tables/views it selects from.
Zero schema change: freeform node labels + the existing USAGE edge type. Only relations that resolve against the registry emit an edge, so DML-only files fabricate nothing.
Scope: DDL labeling + FROM/JOIN lineage only.
Alternatives considered
A new REFERENCES edge type instead of reusing USAGE: avoided to add no edge type; USAGE already means "X refers to Y".
Modeling columns as Field nodes: deferred to keep this small.
Confirmations
I searched existing issues and this is not a duplicate.
Thanks — agreed this is under-modeled today (every CREATE collapsing to an untyped Variable with no lineage). Typing Table / View and emitting FROM/JOIN as USAGE edges through the existing definition registry, with zero schema change and no fabrication for DML-only files, is exactly the right minimal scope.
This is already implemented in your PR #582, which I'm reviewing — let's continue the discussion there. Labeling enhancement / parsing/quality.
CREATE TABLE now produces a Table node, CREATE VIEW / CREATE MATERIALIZED VIEW a View node, and a view's FROM/JOIN relations resolve into view -USAGE-> table lineage edges. Schema-qualified DDL (CREATE TABLE app.users) is named by the table identifier rather than the schema prefix, and CREATE PROCEDURE now types as Function. DML-only files still produce no relation nodes — no fabricated lineage, exactly as you scoped it.
The implementation is distilled from your PR #582 with co-authorship credit; the details of what was added around it are in #1749.
Thank you for the precise write-up here — the "every CREATE collapses to an untyped Variable" framing is what made the fix obvious, and the accompanying PR made it concrete.
Activity
DeusData commentedon Jun 23, 2026
Thanks — agreed this is under-modeled today (every
CREATEcollapsing to an untypedVariablewith no lineage). TypingTable/Viewand emitting FROM/JOIN asUSAGEedges through the existing definition registry, with zero schema change and no fabrication for DML-only files, is exactly the right minimal scope.This is already implemented in your PR #582, which I'm reviewing — let's continue the discussion there. Labeling
enhancement/parsing/quality.feat(sql): first-class Table/View nodes with FROM/JOIN lineage
DeusData commentedon Aug 20, 2026
Fixed on
main— landed in #1749, commit 7ba84e3 (merge 4bbc978).CREATE TABLEnow produces a Table node,CREATE VIEW/CREATE MATERIALIZED VIEWa View node, and a view'sFROM/JOINrelations resolve intoview -USAGE-> tablelineage edges. Schema-qualified DDL (CREATE TABLE app.users) is named by the table identifier rather than the schema prefix, andCREATE PROCEDUREnow types asFunction. DML-only files still produce no relation nodes — no fabricated lineage, exactly as you scoped it.The implementation is distilled from your PR #582 with co-authorship credit; the details of what was added around it are in #1749.
Thank you for the precise write-up here — the "every
CREATEcollapses to an untypedVariable" framing is what made the fix obvious, and the accompanying PR made it concrete.