google-bigquery - 如何使用 BigQuery 命令行工具执行一次性 S3 数据传输?
问题描述
如果您使用控制台,从S3 到 BigQuery的传输可以正常工作。在命令行上,我也可以正常工作,只是有一个参数我找不到如何配置。
在控制台 UI 上,您有“计划选项”,您可以将重复设置为“按需”:
但是在命令行上我找不到将传输设置为“按需”的方法。你知道我需要传递哪个参数来按需设置它吗?它会自动设置每 24 小时的时间表。
示例运行:
bq mk --transfer_config \
--target_dataset=my_dataset \
--display_name="my_transfer" \
--params='{"data_path":"s3://my_bucket/my_path*",
"destination_table_name_template":"testing",
"file_format":"CSV",
"max_bad_records":"1",
"ignore_unknown_values":"true",
"field_delimiter":";",
"skip_leading_rows":"0",
"allow_quoted_newlines":"false",
"allow_jagged_rows":"false",
"access_key_id": "",
"secret_access_key": ""}' \
--data_source=amazon_s3
#how can I setup the schedule options as on demand?
解决方案
您需要disableAutoScheduling
在 DTS API 中将该参数设置为 false。
例如:
{
"dataSourceId":"google_cloud_storage",
"displayName":"bar",
"params":{
"destination_table_name_template":"bart",
"data_path_template":"gs://fuzzy-wuzzy/wiki_1M.csv",
"write_disposition":"APPEND",
"file_format":"CSV",
"max_bad_records":"0",
"field_delimiter":",",
"skip_leading_rows":"0"
},
"emailPreferences":{
"enableFailureEmail":false
},
"notificationPubsubTopic":null,
"destinationDatasetId":"another_test",
"schedule":"",
"scheduleOptions":{
"disableAutoScheduling":true
}
}
要通过 BigQuery CLI 工具执行此操作,您需要使用该no_auto_scheduling
标志。
推荐阅读
- reactjs - 为什么 react-google-maps 渲染一个 Circle 组件两次?
- azure - 使用服务主体从 DataBricks 连接到 Azure SQL 数据库
- installation - 如何用composer安装mpdf v8(目前只安装v6)
- angular - 处理表单 POST 提交
- git - 每次我需要添加库时
- performance - 找到 N 个最近的海龟的最有效方法是什么?
- excel - 将数据粘贴到多个单元格并使用循环时键入 Mismatch VBA
- java - 根据 Gradle 文件中的配置文件区分依赖关系
- winapi - 从 C#/F# 使用 IColumnManager 获取/设置列
- git - Github 拉取请求显示错误的差异