Parse.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 java.util.Map;
12
import lombok.AllArgsConstructor;
13
import lombok.EqualsAndHashCode;
14
import lombok.Getter;
15
import lombok.RequiredArgsConstructor;
16
import lombok.Setter;
17
import lombok.ToString;
18
import org.opensearch.sql.ast.AbstractNodeVisitor;
19
import org.opensearch.sql.ast.expression.Literal;
20
import org.opensearch.sql.ast.expression.ParseMethod;
21
import org.opensearch.sql.ast.expression.UnresolvedExpression;
22
23
/**
24
 * AST node represent Parse with regex operation.
25
 */
26
@Getter
27
@Setter
28
@ToString
29
@EqualsAndHashCode(callSuper = false)
30
@RequiredArgsConstructor
31
@AllArgsConstructor
32
public class Parse extends UnresolvedPlan {
33
  /**
34
   * Method used to parse a field.
35
   */
36
  private final ParseMethod parseMethod;
37
38
  /**
39
   * Field.
40
   */
41
  private final UnresolvedExpression sourceField;
42
43
  /**
44
   * Pattern.
45
   */
46
  private final Literal pattern;
47
48
  /**
49
   * Optional arguments.
50
   */
51
  private final Map<String, Literal> arguments;
52
53
  /**
54
   * Child Plan.
55
   */
56
  private UnresolvedPlan child;
57
58
  @Override
59
  public Parse attach(UnresolvedPlan child) {
60
    this.child = child;
61 1 1. attach : replaced return value with null for org/opensearch/sql/ast/tree/Parse::attach → NO_COVERAGE
    return this;
62
  }
63
64
  @Override
65
  public List<UnresolvedPlan> getChild() {
66 1 1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/Parse::getChild → KILLED
    return ImmutableList.of(this.child);
67
  }
68
69
  @Override
70
  public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) {
71 1 1. accept : replaced return value with null for org/opensearch/sql/ast/tree/Parse::accept → KILLED
    return nodeVisitor.visitParse(this, context);
72
  }
73
}

Mutations

61

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

66

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

71

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

Active mutators

Tests examined


Report generated by PIT 1.9.0