dakrone / cheshire

Clojure JSON and JSON SMILE (binary json format) encoding/decoding
https://github.com/dakrone/cheshire
MIT License
1.49k stars 152 forks source link

Can't lazily parse large JSON objects #62

Open conan opened 10 years ago

conan commented 10 years ago

Cheshire has support for lazily parsing JSON files containing large numbers of objects, but not for parsing large objects themselves.

For example:

{"stars" : [
    {"name" : "Betelgeuse", "magnitude" : 0.58},
    {"name" : "Rigel", "magnitude" : 0.12},
    ... 300 billion others ...
    {"name" : "Antares", "magnitude" : 0.92}]}

Trying to use Cheshire to lazily get the stars in the Milky Way one by one from this JSON doesn't work - if I try to parse the "stars" object using core/parsed-seq, it calls directly into parse/parse*, which bypasses the lazy array functionality in parse/parse, and attempts to evaluate the entire galaxy. Even using parse/parse directly doesn't seem to work (but I'm not sure why).

carylee commented 9 years ago

I'd love to be able to do this as well. https://github.com/dominictarr/JSONStream does this really nicely.

jgalrito commented 4 years ago

Any chance of this happening?