bq commandのscheduled query操作メモ
ただのメモです。
scheduled query一覧表示
$ bq ls --transfer_config --transfer_location=us
name displayName dataSourceId state
----------------------------------------------------------------------------------------- ------------------------------------------------ ----------------- -----------
projects/000000000000/locations/us/transferConfigs/00000000-0000-0000-0000-000000000000 my_scheduled_query scheduled_query SUCCEEDED
scheduled queryの設定表示
$ bq show --format=prettyjson --transfer_config "projects/000000000000/locations/us/transferConfigs/00000000-0000-0000-0000-000000000000"
{
"dataSourceId": "scheduled_query",
"datasetRegion": "us",
"destinationDatasetId": "samples",
"displayName": "my_scheduled_query",
"emailPreferences": {
"enableFailureEmail": true
},
"name": "projects/000000000000/locations/us/transferConfigs/00000000-0000-0000-0000-000000000000",
"params": {
"destination_table_name_template": "sample2",
"query": "SELECT * FROM samples.sample LIMIT 1",
"write_disposition": "WRITE_APPEND"
},
"scheduleOptions": {
"disableAutoScheduling": true
},
"state": "FAILED",
"updateTime": "2020-01-01T00:00:00.000000Z",
"userId": "xxxxxxxxxxxxxxxxxxx"
}
OnDemandQueryを実行する
$ bq mk \
--transfer_run \
--run_time="2020-01-01T00:00:00+09:00" \
projects/000000000000/locations/us/transferConfigs/00000000-0000-0000-0000-000000000000
scheduled queryを更新する
$ cat << __JSON__ > /tmp/param.json
{
"query": "SELECT * FROM samples.sample LIMIT 2",
"destination_table_name_template": "sample2",
"write_disposition": "WRITE_APPEND"
}
__JSON__
$ bq update \
--transfer_config \
--params="$(cat /tmp/param.json)" \
projects/000000000000/locations/us/transferConfigs/00000000-0000-0000-0000-000000000000
Author And Source
この問題について(bq commandのscheduled query操作メモ), 我々は、より多くの情報をここで見つけました https://qiita.com/mattak/items/148ff2435f462a49b52c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .