|
15 | 15 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.FieldsCommandContext; |
16 | 16 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.HeadCommandContext; |
17 | 17 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.RenameCommandContext; |
18 | | -import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.SearchFilterFromContext; |
19 | 18 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.SearchFromContext; |
20 | | -import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.SearchFromFilterContext; |
21 | 19 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.SortCommandContext; |
22 | 20 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.StatsCommandContext; |
23 | 21 | import static org.opensearch.sql.ppl.antlr.parser.OpenSearchPPLParser.TableFunctionContext; |
@@ -140,23 +138,16 @@ public UnresolvedPlan visitSubSearch(OpenSearchPPLParser.SubSearchContext ctx) { |
140 | 138 | /** Search command. */ |
141 | 139 | @Override |
142 | 140 | public UnresolvedPlan visitSearchFrom(SearchFromContext ctx) { |
143 | | - return visitFromClause(ctx.fromClause()); |
144 | | - } |
145 | | - |
146 | | - @Override |
147 | | - public UnresolvedPlan visitSearchFromFilter(SearchFromFilterContext ctx) { |
148 | | - return new Filter( |
149 | | - ctx.logicalExpression().stream() |
150 | | - .map(this::internalVisitExpression) |
151 | | - .reduce(And::new) |
152 | | - .get()) |
153 | | - .attach(visit(ctx.fromClause())); |
154 | | - } |
155 | | - |
156 | | - @Override |
157 | | - public UnresolvedPlan visitSearchFilterFrom(SearchFilterFromContext ctx) { |
158 | | - return new Filter(internalVisitExpression(ctx.logicalExpression())) |
159 | | - .attach(visit(ctx.fromClause())); |
| 141 | + if (ctx.logicalExpression().isEmpty()) { |
| 142 | + return visitFromClause(ctx.fromClause()); |
| 143 | + } else { |
| 144 | + return new Filter( |
| 145 | + ctx.logicalExpression().stream() |
| 146 | + .map(this::internalVisitExpression) |
| 147 | + .reduce(And::new) |
| 148 | + .get()) |
| 149 | + .attach(visit(ctx.fromClause())); |
| 150 | + } |
160 | 151 | } |
161 | 152 |
|
162 | 153 | /** |
|
0 commit comments