nl2sql

GlobalPlannerNode

Overview


Responsibilities


Position in Execution Graph

Upstream:

Downstream:

Trigger conditions:

flowchart LR
    Decomposer[DecomposerNode] --> Planner[GlobalPlannerNode] --> Router[layer_router]

Inputs

From GraphState:

Validation performed:


Outputs

Mutations to GraphState:

Side effects:


Internal Flow (Step-by-Step)

  1. Extract sub_queries, combine_groups, post_combine_ops.
  2. For each sub‑query, build a scan LogicalNode with RelationSchema from expected schema.
  3. For each combine group, create a combine node and edges from inputs.
  4. For each post‑combine op, create a post_* node and edge from its target combine.
  5. Validate that all edges reference known nodes.
  6. Build ExecutionDAG with sorted nodes/edges.
  7. Compute content_hash and dag_id.
  8. Return GlobalPlannerResponse.
  9. On exception, emit PLANNER_FAILED error.

Contracts & Interfaces

Implements a LangGraph node callable:

def __call__(self, state: GraphState) -> Dict[str, Any]

Key contracts:


Determinism Guarantees


Error Handling

Emits PipelineError with:

Logs failures via logger.error.


Retry + Idempotency


Performance Characteristics


Observability


Configuration


Extension Points


Known Limitations