Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Carbonetto <andrew.carbonetto@improving.com>
  • Loading branch information
acarbonetto committed Jan 9, 2025
1 parent ef8d90e commit 37e1128
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ public void test_cast_json() throws IOException {
JSONObject result =
executeQuery(
String.format(
"source=%s | where json_valid(json_string) | eval casted=cast(json_string as json) | fields test_name, casted",
"source=%s | where json_valid(json_string) | eval casted=cast(json_string as json)"
+ " | fields test_name, casted",
TEST_INDEX_JSON_TEST));
verifySchema(result, schema("test_name", null, "string"), schema("casted", null, "undefined"));
verifyDataRows(
result,
rows("json object", Map.of("a", "1", "b", "2")),
rows("json array", List.of(1,2,3,4)),
rows("json array", List.of(1, 2, 3, 4)),
rows("json scalar string", "abc"),
rows("json empty string", null));
}
Expand All @@ -77,12 +78,14 @@ public void test_json() throws IOException {
result =
executeQuery(
String.format(
"source=%s | where json_valid(json_string) | eval casted=json(json_string) | fields test_name, casted", TEST_INDEX_JSON_TEST));
"source=%s | where json_valid(json_string) | eval casted=json(json_string) | fields"
+ " test_name, casted",
TEST_INDEX_JSON_TEST));
verifySchema(result, schema("test_name", null, "string"), schema("casted", null, "undefined"));
verifyDataRows(
result,
rows("json object", Map.of("a", "1", "b", "2")),
rows("json array", List.of(1,2,3,4)),
rows("json array", List.of(1, 2, 3, 4)),
rows("json scalar string", "abc"),
rows("json empty string", null));
}
Expand Down

0 comments on commit 37e1128

Please sign in to comment.