Skip to content

SQL pushdown lane: JSON-LD twins for the sub-select and UNION ALL paths #1793

Open

Description

@bplatz

The M3 lane (#1788) admits sub-selects as derived tables and explicit UNION branches as one UNION ALL statement. Both are pinned on the SPARQL surface only (it_sql_pushdown_lane.rs: the LANE_ONLY_CASES sub-select cases against the native twin, and the union cases in cases()).

SPARQL and JSON-LD share the IR, so the lowering is common, but nothing pins that the JSON-LD parser produces the same Pattern::Subquery and UNION shapes the lane admits (subquery_is_admissible, block_is_admissible), or that a JSON-LD sub-select over a SQL graph source refuses loudly when the lane declines, as the SPARQL form does (sub_selects_the_lane_cannot_take_still_refuse).

Asked for in the #1788 review as an optional item; deferred to keep that PR's scope.

Twins to add, each with the same statement pin and the same oracle as its SPARQL case:

  • a grouped sub-select joined to the outer rows (native twin oracle)
  • a sub-select projecting an OPTIONAL variable (unbound control + refusal when the outer block binds it)
  • a two-branch UNION sharing one UNION ALL statement, and one whose branches differ in column type (per-branch statements)
  • a seeded union (VALUES outside the graph block) so the shared key-set chunking is covered on the JSON-LD side too

Activity

  1. added
    P3
    area:query
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:query

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions