0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

BigQuery のタイムトラベルで、しゅっとテーブルを戻すときによくつかうコマンドサンプル

Last updated at Posted at 2024-12-26

公式ドキュメントはこれ

bqコマンドで相対指定

ミリ秒で、1日前を指定(-86400000)

bq cp --project_id foobar-project \
foobar-dataset.foobar-table@-86400000 foobar-dataset.foobar-table

ミリ秒で、1時間前を指定(-3600000)

bq cp --project_id foobar-project \
foobar-dataset.foobar-table@-3600000 foobar-dataset.foobar-table

SQLで絶対指定

SELECT
  *
FROM
  foo_dataset.bar_table FOR SYSTEM_TIME AS OF TIMESTAMP("2025-01-01 09:00:00","Asia/Tokyo")
WHERE
  id = 1
;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?