Recursively transform nodes to detect text search patterns
(&self, node: LogicalNode)
| 531 | |
| 532 | /// Recursively transform nodes to detect text search patterns |
| 533 | fn transform_text_search_node(&self, node: LogicalNode) -> Result<LogicalNode, PlanningError> { |
| 534 | match node { |
| 535 | // Transform Filter nodes that contain text search predicates |
| 536 | LogicalNode::Filter { condition, input } => { |
| 537 | // First, recursively transform the input |
| 538 | let transformed_input = Box::new(self.transform_text_search_node(*input)?); |
| 539 | |
| 540 | // Text search is not supported in GraphLite, keep as Filter |
| 541 | Ok(LogicalNode::Filter { |
| 542 | condition, |
| 543 | input: transformed_input, |
| 544 | }) |
| 545 | } |
| 546 | |
| 547 | // Recursively transform other node types |
| 548 | LogicalNode::Project { expressions, input } => Ok(LogicalNode::Project { |
| 549 | expressions, |
| 550 | input: Box::new(self.transform_text_search_node(*input)?), |
| 551 | }), |
| 552 | |
| 553 | LogicalNode::Join { |
| 554 | left, |
| 555 | right, |
| 556 | join_type, |
| 557 | condition, |
| 558 | } => Ok(LogicalNode::Join { |
| 559 | left: Box::new(self.transform_text_search_node(*left)?), |
| 560 | right: Box::new(self.transform_text_search_node(*right)?), |
| 561 | join_type, |
| 562 | condition, |
| 563 | }), |
| 564 | |
| 565 | LogicalNode::Union { inputs, all } => { |
| 566 | let transformed_inputs: Result<Vec<_>, _> = inputs |
| 567 | .into_iter() |
| 568 | .map(|input| self.transform_text_search_node(input)) |
| 569 | .collect(); |
| 570 | Ok(LogicalNode::Union { |
| 571 | inputs: transformed_inputs?, |
| 572 | all, |
| 573 | }) |
| 574 | } |
| 575 | |
| 576 | LogicalNode::Aggregate { |
| 577 | group_by, |
| 578 | aggregates, |
| 579 | input, |
| 580 | } => Ok(LogicalNode::Aggregate { |
| 581 | group_by, |
| 582 | aggregates, |
| 583 | input: Box::new(self.transform_text_search_node(*input)?), |
| 584 | }), |
| 585 | |
| 586 | LogicalNode::Sort { expressions, input } => Ok(LogicalNode::Sort { |
| 587 | expressions, |
| 588 | input: Box::new(self.transform_text_search_node(*input)?), |
| 589 | }), |
| 590 |
no outgoing calls
no test coverage detected