Skip to content

Commit d91174b

Browse files
Fix the mvexpand doctest
Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
1 parent e3239ae commit d91174b

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

docs/user/ppl/cmd/mvexpand.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fetched rows / total rows = 1/1
118118
```
119119

120120
### Example 5: Missing Field
121-
If the field does not exist in the input schema (for example, it is not mapped or was projected out earlier), mvexpand does not throw an error and produces no rows.
121+
If the field does not exist in the input schema (for example, it is not mapped or was projected out earlier), mvexpand throws a semantic check exception.
122122

123123
PPL query:
124124
```ppl
@@ -132,11 +132,8 @@ source=people
132132

133133
Expected output:
134134
```text
135-
fetched rows / total rows = 0/0
136-
+------+
137-
| tags |
138-
|------|
139-
+------+
135+
{'reason': 'Invalid Query', 'details': "Field 'tags' not found in the schema", 'type': 'SemanticCheckException'}
136+
Error: Query returned no data
140137
```
141138

142139
## Notes about these doctests

integ-test/src/test/java/org/opensearch/sql/ppl/NewAddedCommandsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ public void testTransposeCommand() throws IOException {
217217
public void testMvExpandCommand() throws IOException {
218218
JSONObject result;
219219
try {
220-
executeQuery(String.format("search source=%s | mvexpand address", TEST_INDEX_BANK));
220+
result = executeQuery(String.format("search source=%s | mvexpand address", TEST_INDEX_BANK));
221221
} catch (ResponseException e) {
222222
result = new JSONObject(TestUtils.getResponseBody(e.getResponse()));
223-
verifyQuery(result);
224223
}
224+
verifyQuery(result);
225225
}
226226

227227
private void verifyQuery(JSONObject result) throws IOException {

0 commit comments

Comments
 (0)