Skip to content

M4-PR5: scope-aware predicate pushdown barriers (WITH/ScopeFrame metadata plumbing) #1190

@lmeyerov

Description

@lmeyerov

Deferred from PR #1188 review by design.

Rationale for deferral

Current pushdown rewrite only handles Filter(input=PatternMatch) and does not move predicates across WITH/projection boundaries.

with_barrier_blocks_pushdown() is only meaningful once pass execution has scope metadata (or explicit boundary nodes) to reason over. Wiring it now without that context would be superficial and brittle.

Depends on

Objective

Add real scope-aware barrier enforcement to predicate pushdown by threading scope/boundary information into pass-time analysis and then enforcing with_barrier_blocks_pushdown() with true context.

Scope

  • Define pass-visible scope metadata contract (or explicit WithBarrier/equivalent logical boundary representation).
  • Thread metadata through logical planning into pass manager input.
  • Enforce WITH boundary blocking via with_barrier_blocks_pushdown() in pushdown rewrite logic where applicable.
  • Add targeted tests for allowed vs blocked movement across true scope boundaries.

Acceptance

  • Pushdown decisions across scope boundaries are context-driven, not structural heuristics.
  • WITH-boundary blocking is explicitly tested and enforced with real scope data.
  • No semantic regressions in OPTIONAL / null-extension behavior.

Non-goals

  • No unrelated optimizer-rule additions.
  • No physical planner changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions