From a35f6ced258a023302b24193992476e780051331 Mon Sep 17 00:00:00 2001 From: Yury-Fridlyand Date: Thu, 23 Feb 2023 14:02:31 -0800 Subject: [PATCH] Minor fixes Signed-off-by: Yury-Fridlyand --- .../org/opensearch/sql/storage/read/TableScanBuilder.java | 3 +-- .../opensearch/sql/executor/CanPaginateVisitorTest.java | 7 ------- .../opensearch/sql/executor/PaginatedPlanCacheTest.java | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/org/opensearch/sql/storage/read/TableScanBuilder.java b/core/src/main/java/org/opensearch/sql/storage/read/TableScanBuilder.java index 7dae9b422d..e05cfad94e 100644 --- a/core/src/main/java/org/opensearch/sql/storage/read/TableScanBuilder.java +++ b/core/src/main/java/org/opensearch/sql/storage/read/TableScanBuilder.java @@ -109,7 +109,6 @@ public R accept(LogicalPlanNodeVisitor visitor, C context) { return visitor.visitTableScanBuilder(this, context); } - public boolean pushDownOffset(int i) { - return false; + public void pushDownOffset(int i) { } } diff --git a/core/src/test/java/org/opensearch/sql/executor/CanPaginateVisitorTest.java b/core/src/test/java/org/opensearch/sql/executor/CanPaginateVisitorTest.java index ec4b43401d..c915685ba8 100644 --- a/core/src/test/java/org/opensearch/sql/executor/CanPaginateVisitorTest.java +++ b/core/src/test/java/org/opensearch/sql/executor/CanPaginateVisitorTest.java @@ -46,7 +46,6 @@ public void reject_query_with_select_fields_and_from() { assertFalse(plan.accept(visitor, null)); } - @Test // select x public void reject_query_without_from() { @@ -112,12 +111,6 @@ public void reject_query_with_window_function() { @Test // select * from y, z public void reject_query_with_select_from_multiple_indices() { - // TODO - } - - @Test - // unreal case, added for coverage only - public void reject_project_with_multiple_nodes() { var plan = mock(Project.class); when(plan.getChild()).thenReturn(List.of(AstDSL.relation("dummy"), AstDSL.relation("pummy"))); when(plan.getProjectList()).thenReturn(List.of(AstDSL.allFields())); diff --git a/core/src/test/java/org/opensearch/sql/executor/PaginatedPlanCacheTest.java b/core/src/test/java/org/opensearch/sql/executor/PaginatedPlanCacheTest.java index 7d70095655..fe798461ba 100644 --- a/core/src/test/java/org/opensearch/sql/executor/PaginatedPlanCacheTest.java +++ b/core/src/test/java/org/opensearch/sql/executor/PaginatedPlanCacheTest.java @@ -326,7 +326,7 @@ void compress_decompress_null_or_empty_string() { // test added for coverage only void compress_throws() { var mock = Mockito.mockConstructionWithAnswer(GZIPOutputStream.class, invocation -> null); - assertThrows(Throwable.class, () -> PaginatedPlanCache.compress("¯\\_(ツ)_/¯")); + assertThrows(Throwable.class, () -> PaginatedPlanCache.compress("\\_(`v`)_/")); mock.close(); }