LogicalPlan.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
7
package org.opensearch.sql.planner.logical;
8
9
import java.util.List;
10
import lombok.EqualsAndHashCode;
11
import org.opensearch.sql.planner.PlanNode;
12
13
/**
14
 * The abstract base class for all the Logical Plan node.
15
 */
16
@EqualsAndHashCode(callSuper = false)
17
public abstract class LogicalPlan implements PlanNode<LogicalPlan> {
18
19
  private List<LogicalPlan> childPlans;
20
21
  public LogicalPlan(List<LogicalPlan> childPlans) {
22
    this.childPlans = childPlans;
23
  }
24
25
  /**
26
   * Accept the {@link LogicalPlanNodeVisitor}.
27
   *
28
   * @param visitor visitor.
29
   * @param context visitor context.
30
   * @param <R>     returned object type.
31
   * @param <C>     context type.
32
   * @return returned object.
33
   */
34
  public abstract <R, C> R accept(LogicalPlanNodeVisitor<R, C> visitor, C context);
35
36
  public LogicalPlan replaceChildPlans(List<LogicalPlan> childPlans) {
37
    this.childPlans = childPlans;
38 1 1. replaceChildPlans : replaced return value with null for org/opensearch/sql/planner/logical/LogicalPlan::replaceChildPlans → KILLED
    return this;
39
  }
40
41
42
  @Override
43
  public List<LogicalPlan> getChild() {
44 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/planner/logical/LogicalPlan::getChild → KILLED
    return childPlans;
45
  }
46
}

Mutations

38

1.1
Location : replaceChildPlans
Killed by : org.opensearch.sql.planner.optimizer.LogicalPlanOptimizerTest.[engine:junit-jupiter]/[class:org.opensearch.sql.planner.optimizer.LogicalPlanOptimizerTest]/[method:push_filter_under_sort()]
replaced return value with null for org/opensearch/sql/planner/logical/LogicalPlan::replaceChildPlans → KILLED

44

1.1
Location : getChild
Killed by : org.opensearch.sql.planner.logical.LogicalPlanNodeVisitorTest.[engine:junit-jupiter]/[class:org.opensearch.sql.planner.logical.LogicalPlanNodeVisitorTest]/[method:logicalPlanShouldTraversable()]
replaced return value with Collections.emptyList for org/opensearch/sql/planner/logical/LogicalPlan::getChild → KILLED

Active mutators

Tests examined


Report generated by PIT 1.9.0