Skip to content

Denorm OPTIONAL count(a) on the anchor dangles (a.code vs __denorm_scan_a's Origin); composite-VLP SQL malformed (follow-ups to #659) #683

Description

@genezhang

Two pre-existing residuals surfaced during the #682 (#659) adversarial review. Both are byte-identical to main (NOT introduced by #659); #659 deliberately left them untouched.

Residual 1 — denorm OPTIONAL count(a) on the ANCHOR dangles

MATCH (a:Airport) OPTIONAL MATCH (a)-[:FLIGHT*2..3]->(b:Airport) RETURN count(a) (aggregating the ANCHOR a, not the far endpoint) renders count(a.code) against the __denorm_scan_a node-scan CTE, which projects Origin (the physical column) not code (logical) → dangling.

This goes through the anchor-alias / __denorm_scan_a path, NOT the VLP CTE endpoint rewriter (rewrite_render_expr_for_vlp_with_endpoint_info) that #659 fixed — so #659's miss-fallback id-resolution doesn't reach it. Fix direction: apply an analogous logical-id→physical resolution (or the canonical scan-CTE id column) at the __denorm_scan_a projection site. Adjacent to #644 (the denorm OPTIONAL-VLP anchor-join family).

Residual 2 — composite-id VLP SQL broadly malformed

Composite-id VLP CTEs (e.g. AirportComposite with node_id: [code, state] on schemas/dev/flights_denorm_mixed_sources.yaml) emit unquoted composite-comma column references throughout the CTE — a pre-existing composite-VLP defect. #659 correctly leaves composite loud/untouched per #605 discipline (the !is_composite() guard). Tracked with #604/#605/#627/#631 composite-VLP family.

Both are loud/dangling (ground-rule-1 safe), not silent-wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions