-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Support for Field Star in Nested Function (#1773)
* Add Support for Field Star in Nested Function. Signed-off-by: forestmvey <[email protected]> * Removing toString for NestedAllTupleFields. Signed-off-by: forestmvey <[email protected]> * Adding IT test for nested all fields in invalid clause of SQL statement. Signed-off-by: forestmvey <[email protected]> * Use utility function for checking is nested in NestedAnalyzer. Signed-off-by: forestmvey <[email protected]> * Formatting fixes. Signed-off-by: forestmvey <[email protected]> --------- Signed-off-by: forestmvey <[email protected]> (cherry picked from commit fa840e0) Signed-off-by: forestmvey <[email protected]>
- Loading branch information
1 parent
be164e8
commit 13b3a76
Showing
16 changed files
with
577 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
core/src/main/java/org/opensearch/sql/ast/expression/NestedAllTupleFields.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
package org.opensearch.sql.ast.expression; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.ToString; | ||
import org.opensearch.sql.ast.AbstractNodeVisitor; | ||
import org.opensearch.sql.ast.Node; | ||
|
||
/** | ||
* Represents all tuple fields used in nested function. | ||
*/ | ||
@RequiredArgsConstructor | ||
@EqualsAndHashCode(callSuper = false) | ||
public class NestedAllTupleFields extends UnresolvedExpression { | ||
@Getter | ||
private final String path; | ||
|
||
@Override | ||
public List<? extends Node> getChild() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public <R, C> R accept(AbstractNodeVisitor<R, C> nodeVisitor, C context) { | ||
return nodeVisitor.visitNestedAllTupleFields(this, context); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("nested(%s.*)", path); | ||
} | ||
} |
Oops, something went wrong.