1 | /* | |
2 | * Copyright OpenSearch Contributors | |
3 | * SPDX-License-Identifier: Apache-2.0 | |
4 | */ | |
5 | ||
6 | ||
7 | package org.opensearch.sql.ast.expression; | |
8 | ||
9 | import lombok.AllArgsConstructor; | |
10 | import lombok.EqualsAndHashCode; | |
11 | import lombok.Getter; | |
12 | import lombok.RequiredArgsConstructor; | |
13 | import lombok.ToString; | |
14 | import org.opensearch.sql.ast.AbstractNodeVisitor; | |
15 | ||
16 | /** | |
17 | * Alias abstraction that associate an unnamed expression with a name and an optional alias. | |
18 | * The name and alias information preserved is useful for semantic analysis and response | |
19 | * formatting eventually. This can avoid restoring the info in toString() method which is | |
20 | * inaccurate because original info is already lost. | |
21 | */ | |
22 | @AllArgsConstructor | |
23 | @EqualsAndHashCode(callSuper = false) | |
24 | @Getter | |
25 | @RequiredArgsConstructor | |
26 | @ToString | |
27 | public class Alias extends UnresolvedExpression { | |
28 | ||
29 | /** | |
30 | * Original field name. | |
31 | */ | |
32 | private final String name; | |
33 | ||
34 | /** | |
35 | * Expression aliased. | |
36 | */ | |
37 | private final UnresolvedExpression delegated; | |
38 | ||
39 | /** | |
40 | * Optional field alias. | |
41 | */ | |
42 | private String alias; | |
43 | ||
44 | @Override | |
45 | public <T, C> T accept(AbstractNodeVisitor<T, C> nodeVisitor, C context) { | |
46 |
1
1. accept : replaced return value with null for org/opensearch/sql/ast/expression/Alias::accept → KILLED |
return nodeVisitor.visitAlias(this, context); |
47 | } | |
48 | } | |
Mutations | ||
46 |
1.1 |