Class PhysicalPlanJson
java.lang.Object
com.darkcollective.relix.plan.internal.PhysicalPlanJson
Serializes a physical
PhysicalNode plan to JSON.
This is the machine-readable counterpart to PhysicalPlanPrinter's
ASCII tree: like that printer it surfaces the physical decisions
invisible in the logical IR — the SQL pushed to a connection
(PhysicalNode.PushedScan) and each join's algorithm and build side — but
as structured output for the playground's physical-plan panel.
Node shape
Every node is a JSON object withop (the operator name), its already
resolved schema ({open, columns}), estimatedRows (the
planner's cardinality estimate, or null when it made none — which is
not the same as 0), and children.
Nodes that carry a physical decision add fields:
Scan—source(the base relation name)PushedScan—connectorType,connection, and the pushedqueryJoin—kind,algorithm,buildSetOp—kindUnnest—column,outer,ordinality(if present)Limit—count,offset(or null)Distinct/Aggregate—streaming(single-pass over an ordered input)
Unlike the logical plan, a physical node's schema is always resolved, so
schema is never null; an open (schema-on-read) node renders as
{"open": true, "columns": []}.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringtoJson(PhysicalNode root) Serializes the plan rooted atrootto a standalone JSON string.static StringtoJson(PhysicalNode root, PlanEstimates estimates) Serializes the plan rooted atrootto a standalone JSON string, annotating each node with its estimated row count.
-
Method Details
-
toJson
Serializes the plan rooted atrootto a standalone JSON string.- Parameters:
root- the physical plan root; must not be null- Returns:
- the JSON document for the plan
-
toJson
Serializes the plan rooted atrootto a standalone JSON string, annotating each node with its estimated row count.- Parameters:
root- the physical plan root; must not be nullestimates- the estimates recorded while planning; must not be null- Returns:
- the JSON document for the plan
-