Split a large json file into multiple smaller files

前端 未结 4 1424
臣服心动
臣服心动 2021-02-04 08:21

I have a large JSON file, about 5 million records and a file size of about 32GB, that I need to get loaded into our Snowflake Data Warehouse. I need to get this file broken up i

4条回答
  •  被撕碎了的回忆
    2021-02-04 08:34

    Answering the question whether Python or Node will be better for the task would be an opinion and we are not allowed to voice our opinions on Stack Overflow. You have to decide yourself what you have more experience in and what you want to work with - Python or Node.

    If you go with Node, there are some modules that can help you with that task, that do streaming JSON parsing. E.g. those modules:

    • https://www.npmjs.com/package/JSONStream
    • https://www.npmjs.com/package/stream-json
    • https://www.npmjs.com/package/json-stream

    If you go with Python, there are streaming JSON parsers here as well:

    • https://github.com/kashifrazzaqui/json-streamer
    • https://github.com/danielyule/naya
    • http://www.enricozini.org/blog/2011/tips/python-stream-json/

提交回复
热议问题