# wrangling large json files

**URL:** https://discourse.julialang.org/t/wrangling-large-json-files/18505
**Category:** Data
**Tags:** question, json, query
**Created:** [December 10, 2018, 3:52am UTC](https://discourse.julialang.org/t/wrangling-large-json-files/18505 "2018-12-10T03:52:57Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![lwabeke](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwabeke/32/4005_2.png) [@lwabeke](https://discourse.julialang.org/u/lwabeke)
#### Post date: [December 10, 2018, 8:07am UTC](https://discourse.julialang.org/t/wrangling-large-json-files/18505/2 "2018-12-10T08:07:18Z")

</div>

I believe the standard JSON.jl package will not work, unless you have huge amounts of RAM, since it creates a complete dictionary of the JSON object. I haven’t tried the other JSON packages (JSON2.jl and Json2.jl on Github).

It might be worthwhile to have a look at LazyJSON it description here of seeming to only parse the parts that you need seems to match your requirement to be able to operate on 100GB files:

> [@Announce: A different way to read JSON data, LazyJSON.jl](https://discourse.julialang.org/t/announce-a-different-way-to-read-json-data-lazyjson-jl/9046):
>
> [LazyJSON.jl](https://github.com/samoconnor/LazyJSON.jl) implements yet another a different way of reading JSON data in Julia. I wrote this as a proof of concept and it is probably not production ready, but if you work with JSON data in a performance sensitive application, this approach might be beneficial. Documentation is in [README.md](https://github.com/samoconnor/LazyJSON.jl/blob/master/README.md). [LazyJSON.jl](https://github.com/samoconnor/LazyJSON.jl) provides direct access to values stored in a JSON text though standard Julia interfaces: Number, AbstractString, AbstractVector and AbstractDict. LazyJSON is lazy in the sense that it does no…

I’m assuming there are many entries on each level of the hierarchy. I would think that what you need conceptually is to maintain pointers to the start (and maybe end) of each level of the hierarchy you enter in a depth first type manner, then you can try to minimise what you need to reprocess when you want to jump to a different part. That might be a reusable library built from parts of the different JSON libraries if that isn’t what LazyJSON already provides.  
If the number of elements at the top layer is not many, it might be worthwhile to split it into a few separate JSON files, which each then only contain 2 levels of the hierarchy, making parts easier to manage.

---

_[View the full topic](https://discourse.julialang.org/t/wrangling-large-json-files/18505)._
