Skip to content

Commit

Permalink
Merge branch 'main' into feature/pagination/integ
Browse files Browse the repository at this point in the history
Signed-off-by: MaxKsyunz <maxk@bitquilltech.com>

# Conflicts:
#	opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java
#	opensearch/src/test/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilderTest.java
  • Loading branch information
MaxKsyunz committed May 30, 2023
2 parents 53f2271 + 6d796ee commit 40dd899
Show file tree
Hide file tree
Showing 15 changed files with 849 additions and 55 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/opensearch/sql/analysis/Analyzer.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ public LogicalPlan visitLimit(Limit node, AnalysisContext context) {
public LogicalPlan visitFilter(Filter node, AnalysisContext context) {
LogicalPlan child = node.getChild().get(0).accept(this, context);
Expression condition = expressionAnalyzer.analyze(node.getCondition(), context);
verifySupportsCondition(condition);

ExpressionReferenceOptimizer optimizer =
new ExpressionReferenceOptimizer(expressionAnalyzer.getRepository(), child);
Expand All @@ -234,7 +233,7 @@ public LogicalPlan visitFilter(Filter node, AnalysisContext context) {
}

/**
* Ensure NESTED function is not used in WHERE, GROUP BY, and HAVING clauses.
* Ensure NESTED function is not used in GROUP BY, and HAVING clauses.
* Fallback to legacy engine. Can remove when support is added for NESTED function in WHERE,
* GROUP BY, ORDER BY, and HAVING clauses.
* @param condition : Filter condition
Expand Down
23 changes: 0 additions & 23 deletions core/src/test/java/org/opensearch/sql/analysis/AnalyzerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1048,29 +1048,6 @@ public void nested_group_by_clause_throws_syntax_exception() {
exception.getMessage());
}

/**
* Ensure Nested function falls back to legacy engine when used in WHERE clause.
* TODO Remove this test when support is added.
*/
@Test
public void nested_where_clause_throws_syntax_exception() {
SyntaxCheckException exception = assertThrows(SyntaxCheckException.class,
() -> analyze(
AstDSL.filter(
AstDSL.relation("schema"),
AstDSL.equalTo(
AstDSL.function("nested", qualifiedName("message", "info")),
AstDSL.stringLiteral("str")
)
)
)
);
assertEquals("Falling back to legacy engine. Nested function is not supported in WHERE,"
+ " GROUP BY, and HAVING clauses.",
exception.getMessage());
}


/**
* SELECT name, AVG(age) FROM test GROUP BY name.
*/
Expand Down
1 change: 1 addition & 0 deletions docs/dev/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
+ **SQL**
+ [Aggregate Window Function](sql-aggregate-window-function.md): aggregate window function support
+ [Nested Function In Select Clause](sql-nested-function-select-clause.md): Nested function support in sql select clause
+ [Nested Function In Where Clause](sql-nested-function-where-clause.md): Nested function support in sql where clause
+ **Piped Processing Language**

### Query Processing
Expand Down
Loading

0 comments on commit 40dd899

Please sign in to comment.