简体   繁体   中英

Handle large JSON with Scala


I have several files with an array inside and I need to concatenate these arrays. The problem is those files are a lot and quite big (around 5mb each, in total more than 100mb).
I tried with PlayJson but I got back a StackOverflow error and I think this is caused by the parsing of the String into the Json Object, so I am looking for another Scala library. Do you have any suggestion?
I don't care too much for this case to marshal the json to an object, I simply need a way to do some simple changes in the JSON structure.

You can use Circe + Iteratee or any parser that supports streaming, eg. Jawn.

Here is a very good tutorial for Circe + Iteratee.

https://github.com/circe/circe/tree/main/examples/sf-city-lots

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM