如何限制从bigquery导出到gcs的文件的大小? [英] how to limit the size of the file that exporting from bigquery to gcs?

查看:92
本文介绍了如何限制从bigquery导出到gcs的文件的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用python代码将数据从bigquery导出到gcs,然后使用gsutil导出到s3!但是在导出到gcs之后,我发现某些文件的大小超过5 GB,gsutil无法处理?所以我想要知道限制尺寸的方法

I Used the python code for exporting data from bigquery to gcs,and then using gsutil to export to s3!But after exporting to gcs ,I noticed the some files are more tha 5 GB,which gsutil cannnot deal?So I want to know the way for limiting the size

推荐答案

因此,在问题跟踪器之后,采取此方法的正确方法是.

So after the issue tracker, the correct way to take this is.

  1. 单个URI ['gs://[YOUR_BUCKET]/file-name.json']

如果您希望BigQuery将数据导出到单个URI,请使用单个URI 文件.使用此方法导出的最大数据为1 GB.

Use a single URI if you want BigQuery to export your data to a single file. The maximum exported data with this method is 1 GB.

请注意,数据大小最大为1GB,而1GB则不是导出的文件大小.

Please note that data size is up to a maximum of 1GB, and the 1GB is not for the file size that is exported.

  1. 单个通配符URI ['gs://[YOUR_BUCKET]/file-name-*.json']

如果您认为导出的数据集将是一个通配符URI,请使用 大于1 GB. BigQuery会将您的数据分成多个文件 在提供的模式上.导出的文件大小可能会有所不同,并且文件不会 大小相等.

Use a single wildcard URI if you think your exported data set will be larger than 1 GB. BigQuery shards your data into multiple files based on the provided pattern. Exported files size may vary, and files won't be equally in size.

因此,当数据大小超过1 GB时,您再次需要使用此方法,并且生成的文件大小可能会有所不同,并且可能会超过1 GB,因为您提到此方法将发生5GB和160Mb对. /p>

So again you need to use this method when your data size is above 1 GB, and the resulting files size may vary, and may go beyond the 1 GB, as you mentioned 5GB and 160Mb pair would happen on this method.

  1. 多个通配符URI

  1. Multiple wildcard URIs

['gs://my-bucket/file-name-1-*.json', 'gs://my-bucket/file-name-2-*.json', 'gs://my-bucket/file-name-3-*.json']

['gs://my-bucket/file-name-1-*.json', 'gs://my-bucket/file-name-2-*.json', 'gs://my-bucket/file-name-3-*.json']

如果要对导出输出进行分区,请使用多个通配符URI. 如果您正在运行并行处理作业,则可以使用此选项 通过Google Cloud Platform上的Hadoop之类的服务.确定如何 许多工人可以处理该作业,并为每个作业创建一个URI 工人. BigQuery将每个URI位置视为一个分区,并使用 并行处理以将数据分片成每个文件中的多个文件 位置.

Use multiple wildcard URIs if you want to partition the export output. You would use this option if you're running a parallel processing job with a service like Hadoop on Google Cloud Platform. Determine how many workers are available to process the job, and create one URI per worker. BigQuery treats each URI location as a partition, and uses parallel processing to shard your data into multiple files in each location.

这里同样适用,导出的文件大小可能会超过1 GB.

the same applies here as well, exported file sizes may vary beyond 1 GB.

这篇关于如何限制从bigquery导出到gcs的文件的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆