Skip to content

Commit 14ad058

Browse files
committed
Adding IT test for nested all fields in invalid clause of SQL statement.
Signed-off-by: forestmvey <[email protected]>
1 parent 04dcea2 commit 14ad058

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

integ-test/src/test/java/org/opensearch/sql/sql/NestedIT.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,4 +501,23 @@ public void nested_function_all_subfields_and_non_nested_field() {
501501
rows("i", 5, "a", 4),
502502
rows("zz", 6, "zz", new JSONArray(List.of(3, 4))));
503503
}
504+
505+
@Test
506+
public void nested_function_all_subfields_in_wrong_clause() {
507+
String query = "SELECT * FROM " + TEST_INDEX_NESTED_TYPE + " ORDER BY nested(message.*)";
508+
509+
Exception exception = assertThrows(RuntimeException.class, () ->
510+
executeJdbcRequest(query));
511+
512+
assertTrue(exception.getMessage().contains("" +
513+
"{\n" +
514+
" \"error\": {\n" +
515+
" \"reason\": \"There was internal problem at backend\",\n" +
516+
" \"details\": \"Invalid use of expression nested(message.*)\",\n" +
517+
" \"type\": \"UnsupportedOperationException\"\n" +
518+
" },\n" +
519+
" \"status\": 503\n" +
520+
"}"
521+
));
522+
}
504523
}

0 commit comments

Comments
 (0)