Head.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.Getter;
14
import lombok.RequiredArgsConstructor;
15
import lombok.Setter;
16
import lombok.ToString;
17
import org.opensearch.sql.ast.AbstractNodeVisitor;
18
19
/**
20
 * AST node represent Head operation.
21
 */
22
@Getter
23
@Setter
24
@ToString
25
@EqualsAndHashCode(callSuper = false)
26
@RequiredArgsConstructor
27
@AllArgsConstructor
28
public class Head extends UnresolvedPlan {
29
30
  private UnresolvedPlan child;
31
  private final Integer size;
32
  private final Integer from;
33
34
  @Override
35
  public Head attach(UnresolvedPlan child) {
36
    this.child = child;
37 1 1. attach : replaced return value with null for org/opensearch/sql/ast/tree/Head::attach → NO_COVERAGE
    return this;
38
  }
39
40
  @Override
41
  public List<UnresolvedPlan> getChild() {
42 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/Head::getChild → KILLED
    return ImmutableList.of(this.child);
43
  }
44
45
  @Override
46
  public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
47 1 1. accept : replaced return value with null for org/opensearch/sql/ast/tree/Head::accept → KILLED
    return nodeVisitor.visitHead(this, context);
48
  }
49
}

Mutations

37

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

42

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

47

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

Active mutators

Tests examined


Report generated by PIT 1.9.0