diff --git a/integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java b/integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java index b86616d511..80886fe779 100644 --- a/integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java @@ -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( diff --git a/opensearch/src/test/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactoryTest.java b/opensearch/src/test/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactoryTest.java index 27ded89f7d..a7e3531e8b 100644 --- a/opensearch/src/test/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactoryTest.java +++ b/opensearch/src/test/java/org/opensearch/sql/opensearch/data/value/OpenSearchExprValueFactoryTest.java @@ -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(