diff --git a/integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java b/integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java index b8e5b2a572..791d7ca7db 100644 --- a/integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/ppl/SearchCommandIT.java @@ -54,10 +54,18 @@ public void testSearchCommandWithoutSearchKeyword() throws IOException { @Test public void testSearchCommandWithSpecialIndexName() throws IOException { - executeRequest(new Request("PUT", "/logs-2021.01.11")); + // A minimal `{"properties":{}}` mapping is required so the analytics-engine + // catalog (OpenSearchSchemaBuilder.buildSchema) actually surfaces the index — + // mapping-less indices are skipped and the parser then fails with + // "Table 'logs-2021.01.11' not found". Routing through TestUtils also + // honors the tests.analytics.parquet_indices toggle. + String minimalMapping = "{\"mappings\":{\"properties\":{}}}"; + org.opensearch.sql.legacy.TestUtils.createIndexByRestClient( + client(), "logs-2021.01.11", minimalMapping); verifyDataRows(executeQuery("search source=logs-2021.01.11")); - executeRequest(new Request("PUT", "/logs-7.10.0-2021.01.11")); + org.opensearch.sql.legacy.TestUtils.createIndexByRestClient( + client(), "logs-7.10.0-2021.01.11", minimalMapping); verifyDataRows(executeQuery("search source=logs-7.10.0-2021.01.11")); }