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?

More than 1 year has passed since last update.

BigQuery、redashのお掃除を効率的に行う

Last updated at Posted at 2022-09-22

グロース活動量と比例して、増える分析用クエリ。何年も運用していると不要なものが出てきたり、定義変更 / データ変更に伴い過去のものも修正必要になって影響範囲の把握が毎度大変なので、Tipsをストック

BigQueryのviewのクエリ内容に変更箇所が入ってないか確認する

SELECT * FROM __dataset_name__.INFORMATION_SCHEMA.VIEWS
WHERE view_definition like '%xxxxx%' 
-- AND REGEXP_CONTAINS(view_definition, r'(xxxxx|xxxxx|xxxxx)')
;

redashのクエリ内容に変更箇所が入ってないか確認する

-- redash のメタデータのDBへ
select
  q.id
  ,q.name
  ,q.created_at
  ,q.updated_at
  ,q.schedule
  ,q.tags
from
  queries q
where
  query like '%dau%'
  and (not '確認済み' = ANY(tags)    -- 特定のタグを除く場合
  and is_archived = false -- アーカイブではない
order by id
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?