Split a large json file into multiple smaller files

前端 未结 4 1421
臣服心动
臣服心动 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 08:38

    consider to use jq to preprocessing your json files

    it could split and stream your large json files

    jq is like sed for JSON data - you can use it to slice 
    and filter and map and transform structured data with 
    the same ease that sed, awk, grep and friends let you play with text.
    

    see the official documentation and this questions for more.

    extra: for your first questions jq is written by C, it's faster than python/node isn't it ?

提交回复
热议问题