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.EqualsAndHashCode; | |
12 | import lombok.Getter; | |
13 | import lombok.RequiredArgsConstructor; | |
14 | import lombok.ToString; | |
15 | import org.opensearch.sql.ast.AbstractNodeVisitor; | |
16 | import org.opensearch.sql.ast.expression.Map; | |
17 | ||
18 | @ToString | |
19 | @EqualsAndHashCode(callSuper = false) | |
20 | @Getter | |
21 | @RequiredArgsConstructor | |
22 | public class Rename extends UnresolvedPlan { | |
23 | private final List<Map> renameList; | |
24 | private UnresolvedPlan child; | |
25 | ||
26 | public Rename(List<Map> renameList, UnresolvedPlan child) { | |
27 | this.renameList = renameList; | |
28 | this.child = child; | |
29 | } | |
30 | ||
31 | @Override | |
32 | public Rename attach(UnresolvedPlan child) { | |
33 |
1
1. attach : negated conditional → NO_COVERAGE |
if (null == this.child) { |
34 | this.child = child; | |
35 | } else { | |
36 | this.child.attach(child); | |
37 | } | |
38 |
1
1. attach : replaced return value with null for org/opensearch/sql/ast/tree/Rename::attach → NO_COVERAGE |
return this; |
39 | } | |
40 | ||
41 | @Override | |
42 | public List<UnresolvedPlan> getChild() { | |
43 |
1
1. getChild : replaced return value with Collections.emptyList for org/opensearch/sql/ast/tree/Rename::getChild → KILLED |
return ImmutableList.of(child); |
44 | } | |
45 | ||
46 | @Override | |
47 | public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) { | |
48 |
1
1. accept : replaced return value with null for org/opensearch/sql/ast/tree/Rename::accept → KILLED |
return nodeVisitor.visitRename(this, context); |
49 | } | |
50 | } | |
Mutations | ||
33 |
1.1 |
|
38 |
1.1 |
|
43 |
1.1 |
|
48 |
1.1 |