@@ -175,10 +175,9 @@ public void test_cast_json_scalar_to_type() throws IOException {
175
175
result =
176
176
executeQuery (
177
177
String .format (
178
- "source=%s | " +
179
- "where test_name='json scalar boolean true' OR test_name='json scalar boolean false' | " +
180
- "eval casted=cast(json(json_string) as boolean) | " +
181
- "fields test_name, casted" ,
178
+ "source=%s | where test_name='json scalar boolean true' OR test_name='json scalar"
179
+ + " boolean false' | eval casted=cast(json(json_string) as boolean) | fields"
180
+ + " test_name, casted" ,
182
181
TEST_INDEX_JSON_TEST ));
183
182
verifySchema (result , schema ("test_name" , null , "string" ), schema ("casted" , null , "boolean" ));
184
183
verifyDataRows (
@@ -192,16 +191,17 @@ public void test_json_object() throws IOException {
192
191
result =
193
192
executeQuery (
194
193
String .format (
195
- "source=%s | where json_valid(json_string) | " +
196
- "eval obj=json_object('key', json(json_string)) | " +
197
- "fields test_name, obj" ,
194
+ "source=%s | where json_valid(json_string) | "
195
+ + "eval obj=json_object('key', json(json_string)) | "
196
+ + "fields test_name, obj" ,
198
197
TEST_INDEX_JSON_TEST ));
199
198
verifySchema (result , schema ("test_name" , null , "string" ), schema ("obj" , null , "struct" ));
200
199
verifyDataRows (
201
200
result ,
202
201
rows (
203
202
"json nested object" ,
204
- new JSONObject (Map .of ("key" , Map .of ("a" , "1" , "b" , Map .of ("c" , "3" ), "d" , List .of (1 , 2 , 3 ))))),
203
+ new JSONObject (
204
+ Map .of ("key" , Map .of ("a" , "1" , "b" , Map .of ("c" , "3" ), "d" , List .of (1 , 2 , 3 ))))),
205
205
rows ("json object" , new JSONObject (Map .of ("key" , Map .of ("a" , "1" , "b" , "2" )))),
206
206
rows ("json array" , new JSONObject (Map .of ("key" , List .of (1 , 2 , 3 , 4 )))),
207
207
rows ("json scalar string" , Map .of ("key" , "abc" )),
@@ -210,7 +210,6 @@ public void test_json_object() throws IOException {
210
210
rows ("json scalar double" , Map .of ("key" , 2.99792458e8 )),
211
211
rows ("json scalar boolean true" , Map .of ("key" , true )),
212
212
rows ("json scalar boolean false" , Map .of ("key" , false )),
213
- rows ("json empty string" , Map .of ())
214
- );
213
+ rows ("json empty string" , Map .of ()));
215
214
}
216
215
}
0 commit comments