Skip to content

Commit c8bc773

Browse files
committed
Use a parquet-backed index in CalcitePPLAggregationIT.testSimpleCount0
The test created an ad-hoc 'test' index with raw _doc PUTs. On the analytics-engine route (tests.analytics.parquet_indices) that bare auto-created index is not composite/parquet-backed, so it does not route through the analytics engine and the test is not exercising the intended path. Switch to TEST_INDEX_BANK, which init() loads via loadIndex (which injects the parquet settings when the flag is set, 7 docs), so the test is meaningful on both the v2/Calcite and analytics-engine paths. Verified passing on both routes. Diagnosis by Sandesh Kumar. Signed-off-by: Kai Huang <ahkcs@amazon.com>
1 parent c6360e9 commit c8bc773

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

integ-test/src/test/java/org/opensearch/sql/calcite/remote/CalcitePPLAggregationIT.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import java.util.List;
2626
import org.json.JSONObject;
2727
import org.junit.jupiter.api.Test;
28-
import org.opensearch.client.Request;
2928
import org.opensearch.sql.common.utils.StringUtils;
3029
import org.opensearch.sql.exception.SemanticCheckException;
3130
import org.opensearch.sql.ppl.PPLIntegTestCase;
@@ -52,16 +51,15 @@ public void init() throws Exception {
5251

5352
@Test
5453
public void testSimpleCount0() throws IOException {
55-
Request request1 = new Request("PUT", "/test/_doc/1?refresh=true");
56-
request1.setJsonEntity("{\"name\": \"hello\", \"age\": 20}");
57-
client().performRequest(request1);
58-
Request request2 = new Request("PUT", "/test/_doc/2?refresh=true");
59-
request2.setJsonEntity("{\"name\": \"world\", \"age\": 30}");
60-
client().performRequest(request2);
61-
62-
JSONObject actual = executeQuery("source=test | stats count() as c");
54+
// Use TEST_INDEX_BANK (loaded in init via loadIndex, 7 docs) rather than an ad-hoc index
55+
// created with raw _doc PUTs. On the analytics-engine route a bare auto-created index is not
56+
// composite/parquet-backed, so it does not route to the analytics engine; loadIndex injects the
57+
// parquet settings when tests.analytics.parquet_indices is set, keeping this test meaningful on
58+
// both engine paths.
59+
JSONObject actual =
60+
executeQuery(String.format("source=%s | stats count() as c", TEST_INDEX_BANK));
6361
verifySchema(actual, schema("c", "bigint"));
64-
verifyDataRows(actual, rows(2));
62+
verifyDataRows(actual, rows(7));
6563
}
6664

6765
@Test

0 commit comments

Comments
 (0)