arrow2
arrow2 copied to clipboard
`json::infer` inconsistent with `ndjson::infer`
Arrow version: latest
rust version: rustc 1.64.0-nightly (0f4bcadb4 2022-07-30)
The ndjson::infer
method takes in a reader, and num_rows as seen here
json::infer
only takes in a json_deserializer::Value
It would be a nice improvement if the api's were consistent, and you could easily infer schemas for json arrays as well as ndjson.
The main reason is that it is possible to infer from ndjson in a streaming fashion (item by item), but it is usually not possible to do it with json
, since we need the whole object.
But maybe there is a better API?