diff --git a/core/src/main/java/org/opensearch/sql/executor/execution/QueryPlanFactory.java b/core/src/main/java/org/opensearch/sql/executor/execution/QueryPlanFactory.java index 903cecd166..3273eb3c18 100644 --- a/core/src/main/java/org/opensearch/sql/executor/execution/QueryPlanFactory.java +++ b/core/src/main/java/org/opensearch/sql/executor/execution/QueryPlanFactory.java @@ -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 queryResponseListener) { diff --git a/core/src/main/java/org/opensearch/sql/planner/physical/CursorCloseOperator.java b/core/src/main/java/org/opensearch/sql/planner/physical/CursorCloseOperator.java index ecad7d4791..13a37fb61e 100644 --- a/core/src/main/java/org/opensearch/sql/planner/physical/CursorCloseOperator.java +++ b/core/src/main/java/org/opensearch/sql/planner/physical/CursorCloseOperator.java @@ -42,7 +42,7 @@ public List 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() { diff --git a/core/src/test/java/org/opensearch/sql/analysis/AnalyzerTest.java b/core/src/test/java/org/opensearch/sql/analysis/AnalyzerTest.java index c76ec68cd7..d5a8cd4322 100644 --- a/core/src/test/java/org/opensearch/sql/analysis/AnalyzerTest.java +++ b/core/src/test/java/org/opensearch/sql/analysis/AnalyzerTest.java @@ -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; @@ -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()) + ); } }