Commit 294a887
authored
Test inferred schema for json array (#454)
Arrow infer schema internally uses IndexMap to keep track of inferred schema
while updating it through given json objects. Thus the order in which
insertion happens to this map determines the output order for schema fields
as well.
Since the json object in serde_json uses BtreeMap, the iteration is always
ascending by key. This leads to infer_schema producing schema fields in
ascending order when we infer using only one json object.
In case of json array any new fields encountered are added to the last.
Thus output order of infer schema did not provide good enough guarantee.
This is solved in #450. This commit just adds a test for it.1 parent 0401cc5 commit 294a887
1 file changed
+51
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
357 | 408 | | |
358 | 409 | | |
359 | 410 | | |
| |||
0 commit comments