RelationSubquery.java

1
/*
2
 * Copyright OpenSearch Contributors
3
 * SPDX-License-Identifier: Apache-2.0
4
 */
5
6
7
package org.opensearch.sql.ast.tree;
8
9
import com.google.common.collect.ImmutableList;
10
import java.util.List;
11
import lombok.AllArgsConstructor;
12
import lombok.EqualsAndHashCode;
13
import lombok.RequiredArgsConstructor;
14
import lombok.ToString;
15
import org.opensearch.sql.ast.AbstractNodeVisitor;
16
17
/**
18
 * Logical plan node of RelationSubquery.
19
 */
20
@AllArgsConstructor
21
@EqualsAndHashCode(callSuper = false)
22
@RequiredArgsConstructor
23
@ToString
24
public class RelationSubquery extends UnresolvedPlan {
25
  private UnresolvedPlan query;
26
  private String alias;
27
28
  /**
29
   * Take subquery alias as table name.
30
   */
31
  public String getAliasAsTableName() {
32 1 1. getAliasAsTableName : replaced return value with "" for org/opensearch/sql/ast/tree/RelationSubquery::getAliasAsTableName → SURVIVED
    return alias;
33
  }
34
35
  @Override
36
  public List<UnresolvedPlan> getChild() {
37 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/RelationSubquery::getChild → KILLED
    return ImmutableList.of(query);
38
  }
39
40
  @Override
41
  public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
42 1 1. accept : replaced return value with null for org/opensearch/sql/ast/tree/RelationSubquery::accept → KILLED
    return nodeVisitor.visitRelationSubquery(this, context);
43
  }
44
45
  @Override
46
  public UnresolvedPlan attach(UnresolvedPlan child) {
47 1 1. attach : replaced return value with null for org/opensearch/sql/ast/tree/RelationSubquery::attach → NO_COVERAGE
    return this;
48
  }
49
}

Mutations

32

1.1
Location : getAliasAsTableName
Killed by : none
replaced return value with "" for org/opensearch/sql/ast/tree/RelationSubquery::getAliasAsTableName → SURVIVED

37

1.1
Location : getChild
Killed by : org.opensearch.sql.analysis.AnalyzerTest.[engine:junit-jupiter]/[class:org.opensearch.sql.analysis.AnalyzerTest]/[method:from_subquery()]
replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/RelationSubquery::getChild → KILLED

42

1.1
Location : accept
Killed by : org.opensearch.sql.analysis.AnalyzerTest.[engine:junit-jupiter]/[class:org.opensearch.sql.analysis.AnalyzerTest]/[method:from_subquery()]
replaced return value with null for org/opensearch/sql/ast/tree/RelationSubquery::accept → KILLED

47

1.1
Location : attach
Killed by : none
replaced return value with null for org/opensearch/sql/ast/tree/RelationSubquery::attach → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.9.0