简体   繁体   English

如何使用 aws lambda 将 json 文件转换为镶木地板

[英]How to convert a json file in to parquet using aws lambda

s3_obj = s3.Object(s3_bucket, file_prefix)
df= pd.read_json(jsonlines_doc,lines=True)
location=s3_obj.put(Body=json.dumps(jsonlines_doc))
df.to_parquet(location, engine='auto', compression='snappy', index=None)

code not working but able to save it locally imported pyarrow and parquet代码不起作用,但能够将其保存在本地导入的 pyarrow 和镶木地板

Have you tried saving the file first into the /tmp/ available in lambda and then copy it to the s3 bucket of your choice.您是否尝试先将文件保存到 lambda 中可用的 /tmp/ 中,然后将其复制到您选择的 s3 存储桶中。

Just to mention Each Lambda execution container provides 512 MB of ephemeral disk space in the /tmp directory, so if your file is bigger than this size you will probably have to use AWS EFS.顺便提一下,每个 Lambda 执行容器在 /tmp 目录中提供 512 MB 的临时磁盘空间,因此如果您的文件大于此大小,您可能必须使用 AWS EFS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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