【发布时间】:2020-06-10 11:12:47
【问题描述】:
我目前正在使用以下代码通过 PySpark 集群 (dataproc) 将数据加载到 BigQuery 中,但是处理时间过长或因超出执行时间错误而终止。有没有更好更快的方法将 spark df 加载到 BigQuery 中?
output.write \
.format("bigquery") \
.option("table","{}.{}".format(bq_dataset, bq_table)) \
.option("temporaryGcsBucket", gcs_bucket) \
.mode('append') \
.save()
以下是我的 dataproc 集群配置:
Master node : Standard (1 master, N workers)
Machine type : n1-standard-4
Number of GPUs : 0
Primary disk type : pd-standard
Primary disk size : 500GB
Worker nodes : 3
Machine type : n1-standard-4
Number of GPUs : 0
Primary disk type : pd-standard
Primary disk size : 500GB
Image version : 1.4.30-ubuntu18
【问题讨论】:
-
数据的大小是多少?集群的大小是多少——有多少执行器、cpu、内存?
-
df.count()或df.show()运行无限时间并且不执行,不知道为什么,但我猜它不应该是 200-300 行,我已将集群配置添加为问题的一部分。
标签: python google-cloud-platform pyspark google-bigquery google-cloud-dataproc