google-cloud-platform - 将查询结果移动到另一个位置
问题描述
我在 python 文件中定义了一个 Airflow DAG。想对美国本地化的 bigquery 公共数据运行查询,并将结果存储在我在欧盟位置的 biquery 中。在一个 DAG 步骤中管理操作会很棒。
使用如下代码,但它会引发错误:将位置设置为美国,但输出数据集位于另一个位置。
get_data = bigquery_operator.BigQueryOperator(
...
location='US',
sql="""
select ...
from 'bigquery-public-data.new_tork_taxi_trips.tlc_green_trips_2018'''
""",
destination_dataset_table=<my-proj>.<my-dataset>.<my-table>,
...
)
解决方案
请参阅Temporary and permanent tables
BigQuery 文档,当您将查询结果写入永久表时,您要查询的表必须与包含目标表的数据集位于同一位置。
参考:https ://cloud.google.com/bigquery/docs/managing-tables#limitations_on_copying_tables
推荐阅读
- python - 在不影响默认分隔符的情况下打印没有索引的熊猫数据框
- azure-functions - Azure Function App 的 ConfigurationManager.AppSettings 返回空值
- elasticsearch - 如何从 JAVA API 将 scroll_size 设置为 _update_by_query 请求
- pdo - pdo 使用 foreach 插入多行
- svn - 推荐一个好的同行代码审查工具?
- monaco-editor - monaco-editor 中的参数“source”是什么意思?
- python - 当列具有 NaN 值时,如何使用 pandas 对计数进行分组和转换?
- install4j - 如何使用 Install4J 将参数从启动器传递到更新器
- javascript - 从未调用禁用道具上的反应组件功能
- xamarin.android - 在运行通知操作之前,解锁设备