diff --git a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java index 515394c705..17d6467421 100644 --- a/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java +++ b/integ-test/src/test/java/org/opensearch/sql/correctness/tests/TestReportTest.java @@ -69,17 +69,46 @@ public void testFailedReport() { JSONObject actual = new JSONObject(report); JSONObject expected = new JSONObject( - "{ \"summary\": { \"total\": 1, \"success\": 0, \"failure\": 1 }, " - + " \"tests\": [ { \"id\": 1, \"result\": 'Failed', \"sql\":" - + " \"SELECT * FROM accounts\", \"explain\": \"Data row at [0] is different:" - + " this=[Row(values=[world])], other=[Row(values=[hello])]\", \"errors\":" - + " \"[SQLITE_ERROR] SQL error or missing database;\", \"resultSets\": [ " - + " { \"database\": \"H2\", \"schema\": [ { " - + " \"name\": \"firstName\", \"type\": \"text\" } " - + " ], \"dataRows\": [[\"world\"]] }, { " - + " \"database\": \"OpenSearch\", \"schema\": [ { " - + " \"name\": \"firstName\", \"type\": \"text\" } " - + " ], \"dataRows\": [[\"hello\"]] } ] } ]}"); + "{" + + " \"summary\": {" + + " \"total\": 1," + + " \"success\": 0," + + " \"failure\": 1" + + " }," + + " \"tests\": [" + + " {" + + " \"id\": 1," + + " \"result\": 'Failed'," + + " \"sql\": \"SELECT * FROM accounts\"," + + " \"explain\": \"Data row at [0] is different: " + + " this=[Row(values=[world])], " + + " other=[Row(values=[hello])]\"," + + " \"errors\": \"[SQLITE_ERROR] SQL error or missing database;\"," + + " \"resultSets\": [" + + " {" + + " \"database\": \"H2\"," + + " \"schema\": [" + + " {" + + " \"name\": \"firstName\"," + + " \"type\": \"text\"" + + " }" + + " ]," + + " \"dataRows\": [[\"world\"]]" + + " }," + + " {" + + " \"database\": \"OpenSearch\"," + + " \"schema\": [" + + " {" + + " \"name\": \"firstName\"," + + " \"type\": \"text\"" + + " }" + + " ]," + + " \"dataRows\": [[\"hello\"]]" + + " }" + + " ]" + + " }" + + " ]" + + "}"); if (!actual.similar(expected)) { fail("Actual JSON is different from expected: " + actual.toString(2)); diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java index e02de782b4..1abc1d6183 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/TestUtils.java @@ -53,7 +53,8 @@ public static void createIndexByRestClient(RestClient client, String indexName, } /** - * https://github.com/elastic/elasticsearch/pull/49959 Deprecate creation of dot-prefixed index + * https://github.com/elastic/elasticsearch/pull/49959
+ * Deprecate creation of dot-prefixed index * names except for hidden and system indices. Create hidden index by REST client. * * @param client client connection diff --git a/integ-test/src/test/java/org/opensearch/sql/ppl/SystemFunctionIT.java b/integ-test/src/test/java/org/opensearch/sql/ppl/SystemFunctionIT.java index 565c267f7f..d2cd140e99 100644 --- a/integ-test/src/test/java/org/opensearch/sql/ppl/SystemFunctionIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/ppl/SystemFunctionIT.java @@ -29,9 +29,12 @@ public void typeof_sql_types() throws IOException { JSONObject response = executeQuery( String.format( - "source=%s | eval `str` = typeof('pewpew'), `double` = typeof(1.0),`int` =" - + " typeof(12345), `long` = typeof(1234567891011), `interval` = typeof(INTERVAL" - + " 2 DAY) | fields `str`, `double`, `int`, `long`, `interval`", + "source=%s | eval `str` = typeof('pewpew')," + + " `double` = typeof(1.0)," + + "`int` = typeof(12345)," + + " `long` = typeof(1234567891011)," + + " `interval` = typeof(INTERVAL 2 DAY)" + + " | fields `str`, `double`, `int`, `long`, `interval`", TEST_INDEX_DATATYPE_NUMERIC)); // TODO: test null in PPL verifyDataRows(response, rows("KEYWORD", "DOUBLE", "INTEGER", "LONG", "INTERVAL")); diff --git a/integ-test/src/test/java/org/opensearch/sql/util/TestUtils.java b/integ-test/src/test/java/org/opensearch/sql/util/TestUtils.java index bafc213e29..ac5cee118c 100644 --- a/integ-test/src/test/java/org/opensearch/sql/util/TestUtils.java +++ b/integ-test/src/test/java/org/opensearch/sql/util/TestUtils.java @@ -56,7 +56,8 @@ public static void createIndexByRestClient(RestClient client, String indexName, } /** - * https://github.com/elastic/elasticsearch/pull/49959 Deprecate creation of dot-prefixed index + * https://github.com/elastic/elasticsearch/pull/49959
+ * Deprecate creation of dot-prefixed index * names except for hidden and system indices. Create hidden index by REST client. * * @param client client connection