RareTopN.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 java.util.Collections;
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
import org.opensearch.sql.ast.expression.Argument;
19
import org.opensearch.sql.ast.expression.Field;
20
import org.opensearch.sql.ast.expression.UnresolvedExpression;
21
22
/**
23
 * AST node represent RareTopN operation.
24
 */
25
@Getter
26
@Setter
27
@ToString
28
@EqualsAndHashCode(callSuper = false)
29
@RequiredArgsConstructor
30
@AllArgsConstructor
31
public class RareTopN extends UnresolvedPlan {
32
33
  private UnresolvedPlan child;
34
  private final CommandType commandType;
35
  private final List<Argument> noOfResults;
36
  private final List<Field> fields;
37
  private final List<UnresolvedExpression> groupExprList;
38
39
  @Override
40
  public RareTopN attach(UnresolvedPlan child) {
41
    this.child = child;
42 1 1. attach : replaced return value with null for org/opensearch/sql/ast/tree/RareTopN::attach → KILLED
    return this;
43
  }
44
45
  @Override
46
  public List<UnresolvedPlan> getChild() {
47 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/RareTopN::getChild → KILLED
    return Collections.singletonList(this.child);
48
  }
49
50
  @Override
51
  public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
52 1 1. accept : replaced return value with null for org/opensearch/sql/ast/tree/RareTopN::accept → KILLED
    return nodeVisitor.visitRareTopN(this, context);
53
  }
54
55
  public enum CommandType {
56
    TOP,
57
    RARE
58
  }
59
}
60

Mutations

42

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

47

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

52

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

Active mutators

Tests examined


Report generated by PIT 1.9.0