jsonlite icon indicating copy to clipboard operation
jsonlite copied to clipboard

Implement version of write_json that doesn't convert to JSON in memory

Open asieira opened this issue 8 years ago • 1 comments

Depending on the size of the data that needs to be converted to JSON, the current implementation of write_json can fail. That is due to the fact that it calls toJSON to convert the input to a single JSON string, and that can exceed 2^31-1 characters which is the maximum R string size.

So ideally something similar to what was implemented in fromJSON, which can stream data from a connection without loading it all in memory first, can be done for write_json.

asieira avatar Oct 06 '17 21:10 asieira

For such large data I recommend using stream_in and stream_out.

jeroen avatar Oct 07 '17 10:10 jeroen