4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

BigQueryでテーブルの更新時間を取得する方法

Last updated at Posted at 2020-03-13

テーブルの更新時間を取得するには下記の方法がある

SQLで取得する方法

SELECT
  table_id,
  FORMAT_TIMESTAMP('%Y-%m-%d %H:%M:%S', TIMESTAMP_MILLIS(last_modified_time), 'Asia/Tokyo')
FROM
  `データセット名.__TABLES__`
WHERE
  table_id = 'テーブル名'

CLIで取得する方法

(unixtime)

bq show \
--schema \
--format=prettyjson \
プロジェクト名:データセット名.テーブル名 | grep lastModifiedTime

INFORMATION_SCHEMAで取りたいけど、作成日しか取れない(2020/3 現在)

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?