ExecutionDAG from decomposer output.DecomposerNode and layer_router.GlobalPlannerNodepackages/nl2sql/src/nl2sql/pipeline/nodes/global_planner/node.pySubQuery objects into scan nodes.combine nodes for join/union/compare groups.post_* nodes for filter/aggregate/project/sort/limit operations.ExecutionDAG ordering, content hash, and dag_id.Upstream:
DecomposerNodeDownstream:
layer_routerTrigger conditions:
flowchart LR
Decomposer[DecomposerNode] --> Planner[GlobalPlannerNode] --> Router[layer_router]
From GraphState:
decomposer_response.sub_queriesdecomposer_response.combine_groupsdecomposer_response.post_combine_opsValidation performed:
Mutations to GraphState:
global_planner_response (GlobalPlannerResponse with ExecutionDAG)reasoning on successerrors on failureSide effects:
sub_queries, combine_groups, post_combine_ops.scan LogicalNode with RelationSchema from expected schema.combine node and edges from inputs.post_* node and edge from its target combine.ExecutionDAG with sorted nodes/edges.content_hash and dag_id.GlobalPlannerResponse.PLANNER_FAILED error.Implements a LangGraph node callable:
def __call__(self, state: GraphState) -> Dict[str, Any]
Key contracts:
ExecutionDAGLogicalNode, LogicalEdgeRelationSchema, ColumnSpecGlobalPlannerResponseExecutionDAG._layered_toposort() produces stable layer ordering.content_hash is a deterministic hash of nodes/edges/version.Emits PipelineError with:
PLANNER_FAILED on exceptionsLogs failures via logger.error.
global_plannerkind_map and attributes mapping.build_graph() for custom DAG construction.expected_schema is present to build RelationSchema.packages/nl2sql/src/nl2sql/pipeline/nodes/global_planner/node.pypackages/nl2sql/src/nl2sql/pipeline/nodes/global_planner/schemas.py