MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / format_logical_plan

Method format_logical_plan

graphlite/src/plan/trace.rs:716–786  ·  view source on GitHub ↗

Format logical plan as tree

(&self, node: &LogicalNode, indent: usize)

Source from the content-addressed store, hash-verified

714
715 /// Format logical plan as tree
716 fn format_logical_plan(&self, node: &LogicalNode, indent: usize) -> String {
717 let prefix = " ".repeat(indent);
718 let mut output = String::new();
719
720 match node {
721 LogicalNode::NodeScan {
722 variable, labels, ..
723 } => {
724 output.push_str(&format!(
725 "{}NodeScan({}:{})\n",
726 prefix,
727 variable,
728 labels.join("|")
729 ));
730 }
731 LogicalNode::EdgeScan {
732 variable, labels, ..
733 } => {
734 output.push_str(&format!(
735 "{}EdgeScan({}:{})\n",
736 prefix,
737 variable,
738 labels.join("|")
739 ));
740 }
741 LogicalNode::Expand {
742 from_variable,
743 to_variable,
744 edge_labels,
745 input,
746 ..
747 } => {
748 output.push_str(&format!(
749 "{}Expand({} -> {}:{})\n",
750 prefix,
751 from_variable,
752 to_variable,
753 edge_labels.join("|")
754 ));
755 output.push_str(&self.format_logical_plan(input, indent + 1));
756 }
757 LogicalNode::Filter { condition, input } => {
758 output.push_str(&format!("{}Filter({:?})\n", prefix, condition));
759 output.push_str(&self.format_logical_plan(input, indent + 1));
760 }
761 LogicalNode::Project { expressions, input } => {
762 output.push_str(&format!("{}Project({} cols)\n", prefix, expressions.len()));
763 output.push_str(&self.format_logical_plan(input, indent + 1));
764 }
765 LogicalNode::Sort { expressions, input } => {
766 output.push_str(&format!("{}Sort({} cols)\n", prefix, expressions.len()));
767 output.push_str(&self.format_logical_plan(input, indent + 1));
768 }
769 LogicalNode::Limit {
770 count,
771 offset,
772 input,
773 } => {

Callers 1

format_traceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected