Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Loading