Skip to content

Commit

Permalink
Address last PR comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
  • Loading branch information
Yury-Fridlyand committed May 29, 2023
1 parent ca9ecaf commit d7f44aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ boolean canConvertToCursor(UnresolvedPlan plan) {
}

/**
* Creates a {@link CloseCursor} from a cursor.
* Creates a {@link CloseCursor} command on a cursor.
*/
public AbstractPlan createCloseCursor(String cursor,
ResponseListener<ExecutionEngine.QueryResponse> queryResponseListener) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public List<PhysicalPlan> getChild() {
}

/**
* Requires to provide a dummy schema, because this plan node located on the top of the tree.
* Provides an empty schema, because this plan node is always located on the top of the tree.
*/
@Override
public ExecutionEngine.Schema schema() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package org.opensearch.sql.analysis;

import static java.util.Collections.emptyList;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down Expand Up @@ -1657,7 +1658,10 @@ void visit_cursor() {
@Test
public void visit_close_cursor() {
var analyzed = analyze(new CloseCursor().attach(new FetchCursor("pewpew")));
assertTrue(analyzed instanceof LogicalCloseCursor);
assertTrue(analyzed.getChild().get(0) instanceof LogicalFetchCursor);
assertAll(
() -> assertTrue(analyzed instanceof LogicalCloseCursor),
() -> assertTrue(analyzed.getChild().get(0) instanceof LogicalFetchCursor),
() -> assertEquals("pewpew", ((LogicalFetchCursor) analyzed.getChild().get(0)).getCursor())
);
}
}

0 comments on commit d7f44aa

Please sign in to comment.