Skip to content

Commit

Permalink
Adding schema validation for IT test, and another UT for nested arrays.
Browse files Browse the repository at this point in the history
Signed-off-by: forestmvey <[email protected]>
  • Loading branch information
forestmvey committed Jun 21, 2023
1 parent 71147ff commit 5c97d43
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ public void nested_function_with_date_types_as_object_arrays_within_arrays_test(
JSONObject result = executeJdbcRequest(query);

assertEquals(11, result.getInt("total"));
verifySchema(result,
schema("nested(address.moveInDate)", null, "object")
);
verifyDataRows(result,
rows(new JSONObject(Map.of("dateAndTime","1984-04-12 09:07:42"))),
rows(new JSONArray(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,19 @@ public void constructNestedArraysOfStringsReturnsFirstIndex() {
).get("stringV"));
}

@Test
public void constructMultiNestedArraysOfStringsReturnsFirstIndex() {
assertEquals(
stringValue("z"),
tupleValue(
"{\"stringV\":"
+ "[\"z\","
+ "[\"s\"],"
+ "[\"zz\", \"au\"]"
+ "]}"
).get("stringV"));
}

@Test
public void constructArrayOfInts() {
assertEquals(new ExprCollectionValue(
Expand Down

0 comments on commit 5c97d43

Please sign in to comment.