【发布时间】:2019-05-23 14:31:50
【问题描述】:
我正在尝试读取数据流中的 bigquery 数据集。它找不到我指定的 bigquery 数据集/表。
job_name 是 preprocess-ga360-190523-130005
我的 datalab vm、gcs 存储桶和 bigquery 数据集都位于 europe-west2。
由于某种原因,它正在搜索位置 'US' 中的数据集
modules versions are apache-beam 2.5.0,google-cloud-dataflow 2.0.0, google-cloud-bigquery 0.25.0
搜索了文档,但无法找到为什么会发生这种情况的答案。
OUTPUT_DIR = "gs://some-bucket/some-folder/"
#dictionary of pipeline options
options = {
"staging_location": "gs://some-bucket/some-folder/stage/"
"temp_location": "gs://some-bucket/some-folder/tmp/"
"job_name": job_name,
"project": PROJECT,
"runner": "DirectRunner",
"location":'europe-west2',
"region":'europe-west2',
}
#instantiate PipelineOptions object using options dictionary
opts = beam.pipeline.PipelineOptions(flags = [], **options)
#instantantiate Pipeline object using PipelineOptions
with beam.Pipeline(options=opts) as
outfile = "gs://some-bucket/some-folder/train.csv"
(
p | "read_train" >> beam.io.Read(beam.io.BigQuerySource(query =
my_query, use_standard_sql = True))
| "tocsv_train" >> beam.Map(to_csv)
| "write_train" >> beam.io.Write(beam.io.WriteToText(outfile))
)
print("Done")
回复:
HttpError: HttpError 访问 https://www.googleapis.com/bigquery/v2/projects/projects/queries/querystring: 响应:, 内容
【问题讨论】:
标签: python google-cloud-dataflow apache-beam