Skip to content

Commit

Permalink
Address PR comments.
Browse files Browse the repository at this point in the history
Signed-off-by: Mitchell Gale <[email protected]>
  • Loading branch information
MitchellGale committed Aug 14, 2023
1 parent 4ee9597 commit a154b9d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<br>
* Deprecate creation of dot-prefixed index
* names except for hidden and system indices. Create hidden index by REST client.
*
* @param client client connection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<br>
* Deprecate creation of dot-prefixed index
* names except for hidden and system indices. Create hidden index by REST client.
*
* @param client client connection
Expand Down

0 comments on commit a154b9d

Please sign in to comment.