首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在读取BigQuery数据集python SDK的数据流中指定区域

在读取BigQuery数据集python SDK的数据流中指定区域
EN

Stack Overflow用户
提问于 2019-05-23 22:31:51
回答 1查看 356关注 0票数 1

我正在尝试读入数据流中的bigquery数据集。它找不到我指定的bigquery数据集/表。

job_name是预处理-ga360-190523-130005

由于某种原因,它在位置'US‘中搜索数据集

代码语言:javascript
复制
modules versions are apache-beam 2.5.0,google-cloud-dataflow 2.0.0, google-cloud-bigquery 0.25.0

搜索了文档,找不到为什么会发生这种情况的答案。

代码语言:javascript
复制
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")

响应:

‘’cache control‘:'private','date':’清华,2019年5月23日13:00:08 GMT','x-frame-options':'SAMEORIGIN','content-type':'application/json;“原因”:"notFound“},”状态“:"NOT_FOUND”} }

EN

回答 1

Stack Overflow用户

发布于 2019-05-24 01:16:56

在Apache Beam2.5.0Python SDK中,non US query sources weren't yet supported

看起来Apache Beam2.8.0 Python SDK [Release NotesPRJIRA]中添加了支持。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56277513

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档