Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
416 views
in Technique[技术] by (71.8m points)

go - 如何通过查询/ cli / go获取表的到期日期?(How to get table expiration date via query / cli / go?)

I can't find a way to extract table expiration date that is not via the console ( https://console.cloud.google.com/ ).

(我找不到不是通过控制台( https://console.cloud.google.com/ )提取表到期日期的方法。)

We maintain thousands of tables in BQ and we want to enforce the use of table expiration date - so the only way is to collect the data automatically.

(我们在BQ中维护着数千个表,并且我们想强制使用表到期日期-因此,唯一的方法是自动收集数据。)

is this possible via query/cli/go/python/perl/whatever?

(通过query / cli / go / python / perl / whatever可以吗?)

  ask by EldadT translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

this can be done via querying the INFORMATION_SCHEMA.TABLE_OPTIONS:

(这可以通过查询INFORMATION_SCHEMA.TABLE_OPTIONS来完成:)

SELECT * FROM `my_project.my_dataset.INFORMATION_SCHEMA.TABLE_OPTIONS`
where option_name='expiration_timestamp'

the value will be in the option_name column.

(该值将在option_name列中。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...