Skip to main content

Module pattern_match

Module pattern_match 

Source
Expand description

Distributed pattern matching โ€” cross-shard scatter-gather for MATCH.

When a MATCH pattern encounters a ghost edge (destination on another shard), the partial binding row is sent to the target shard for continuation. The target shard resumes pattern expansion from the ghost destination node.

Protocol:

  1. Coordinator broadcasts MATCH query to all shards.
  2. Each shard executes the pattern locally on its CSR.
  3. When a triple crosses a shard boundary (ghost edge):
    • The shard packages the partial binding row + remaining pattern triples.
    • Sends a PatternContinuation to the target shard.
  4. Target shard resumes execution with the partial bindings.
  5. Results from all shards are merged by the coordinator.
  6. Iterate until no new continuations are pending.

Structsยง

DistributedMatchCoordinator
Coordinator state for distributed MATCH execution.
PatternContinuation
A partial MATCH result that needs continuation on another shard.
ShardMatchResult
Coordinator response from a shard for distributed MATCH.