#
Git
Press
Login
Tag
#
Google BigQuery
Tagged
Posts
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
🔍 ERROR
エラー集
sh16ma
published in
🔍 BigQuery
@ 2023/03/24
🔍 エクスポート機能
export data options (uri='gs://エクスポート先のバケット名/csv/sql_*.csv.gz', format='CSV'
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
効率よく使いたい 速く、安く
No exerpt.
sh16ma
published in
🔍 BigQuery
@ 2022/03/11
INFORMATION_SCHEMA
BigQuery INFORMATION_SCHEMA ビューは、BigQuery オブジェクトに関するメタデータ情報を提供するシステム定義の読み取り専用ビューです。『 BigQuery INFORMATION_SCHEMA の概要』より
sh16ma
published in
🔍 BigQuery
@ 2022/08/09
__TABLE__
select * from dataset.__TABLE__;TABLESを利用すると、bq show にも匹敵する情報を全テーブル一括で取得することが出来ます。取れる情報は「テーブル作成日」「テーブル最終更新日」「テーブル行数」「テーブルバイト数」です。
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
🔍疑似中間テーブル作成
too many subqueries or query is too complex の回避
sh16ma
published in
🔍 BigQuery
@ 2022/03/02
🔍クエリ関数化
ユーザー定義関数(UDF)
sh16ma
published in
🔍 BigQuery
@ 2022/06/13
GA4
||ユニバーサルアナリティクス|GA4||:-|:-|:-||データの計測方法 |計測単位:ページ計測方法:セッション|計測単位:イベント計測方法:ユーザー|
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
🔍 GA4 構造化データをフラット化
とんでもなく勉強になるクエリを記述する最強の人を真似て写経兼してみた。(参考記事は「REFERENCE」へ)GA4(Firebase)のデータ構造は、初見〇し過ぎる。。都度、データをこねくり回して抽出もいいが、、、手間過ぎる。そんな時に出会った最強の人。感謝ですm(_ _)m
sh16ma
published in
🔍 BigQuery
@ 2021/09/04
分析入門 - Section10
BigQuery集合演算、ビュー
sh16ma
published in
🔍 BigQuery
@ 2021/09/03
分析入門 - Section11
BigQuery練習問題
sh16ma
published in
🔍 BigQuery
@ 2021/09/02
分析入門 - Section12
BigQueryおまけ(可視化)
sh16ma
published in
🔍 BigQuery
@ 2021/09/11
分析入門 - Session2~3
BigQuery基本設定
sh16ma
published in
🔍 BigQuery
@ 2021/09/10
分析入門 - Section4
BigQuery基本文法
sh16ma
published in
🔍 BigQuery
@ 2021/09/09
分析入門 - Section5
BigQuery集計関数
sh16ma
published in
🔍 BigQuery
@ 2021/09/08
分析入門 - Section6
BigQuery四則演算、条件分岐
sh16ma
published in
🔍 BigQuery
@ 2021/09/07
分析入門 - Section7
BigQuery分析関数
sh16ma
published in
🔍 BigQuery
@ 2021/09/06
分析入門 - Section8
BigQueryテーブル結合
sh16ma
published in
🔍 BigQuery
@ 2021/09/05
分析入門 - Section9
BigQueryサブクエリ
sh16ma
published in
🔍 BigQuery
@ 2022/06/14
Google BigQuery ML
create or replace model {my_project.my_dataset}.{モデル名}options(model_type = 'AUTOML_CLASSIFIER' --( ※ )使用アルゴリズム
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
BigQueryMlでハイパラチューニング
create or repalce model taxi.TOTAL_AMOUNT_MODELoptions (model_type='linear_reg' -- 線形回帰
sh16ma
published in
🔍 BigQuery
@ 2022/06/14
BigQuery ML
(チートシートのDL - Google)
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
BQML ロジステック回帰
GoogleCLoud内部に、BigQueryMLのチュートリアルが用意されている。(なんて親切!)クイックスタート>BigQuery ML で機械学習モデルを作成するcreate model bqml_tutorial.sample_model
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
RFM分析結果からk-平均クラスタリング
No exerpt.
sh16ma
published in
🔍 BigQuery
@ 2022/03/02
時系列
BigQueryのユーザー定義関数について
sh16ma
published in
🔍 BigQuery
@ 2022/03/01
近似集計関数
EDA時や、ざっくり特徴量のカウント等に厳密な結果を求めていない時count(distinct HOGE) を用いないで、近侍集計関数を用いると幸せ。(メモリの節約にもなるし)
sh16ma
published in
🔍 BigQuery
@ 2023/09/21
ARRAY_AGG関数
selectuser_id, ARRAY_AGG(access_pagepath) as pagepath
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
BigQuery Scripting
decleare TERM_START string default '2020-01-01';decleare TERM_END string default '2020-12-31';decleare PREP_TS string;
sh16ma
published in
🔍 BigQuery
@ 2022/02/25
COALESCE関数
selectID
sh16ma
published in
🔍 BigQuery
@ 2022/03/01
COUNTIF関数
Excelや、Spreadsheetではお馴染み、countif()。BigQueryでも使えるよ。select
sh16ma
published in
🔍 BigQuery
@ 2022/01/01
カスタムクエリ
標準パラメータを使用できる
sh16ma
published in
🔍 BigQuery
@ 2022/03/01
EXCEPT演算子
差集合を取得できる。(select * from TABLE1)
sh16ma
published in
🔍 BigQuery
@ 2022/03/01
EXISTS句(式)
exists : 意味・対訳存在する、現存する、(特殊な条件または場所に)ある、現われる、生存する、生きている、(…で)(やっと)生きていく
sh16ma
published in
🔍 BigQuery
@ 2022/05/11
EXTRUCT関数
selectextract(year from rsv_date from) as YEAR, extract(month from rsv_date) as MONTH
sh16ma
published in
🔍 BigQuery
@ 2022/09/26
GREATEST関数
, SHOP_END_TIME as (select*
sh16ma
published in
🔍 BigQuery
@ 2022/05/11
IFNULL関数
null値を代替して置き換える。null回避。NOTE
sh16ma
published in
🔍 BigQuery
@ 2022/03/01
INTERSECT関数
積集合を取得できる。(select * from TABLE1)
sh16ma
published in
🔍 BigQuery
@ 2022/08/25
LAST_DAY関数
No exerpt.
sh16ma
published in
🔍 BigQuery
@ 2022/03/02
LEAD関数 / LAG関数
LEAD ( scalar_expression [ ,offset(1) ] , [ default(null) ] )OVER ( [ partition_by_clause ] order_by_clause )現在行の後ろの行を持ってくる。
sh16ma
published in
🔍 BigQuery
@ 2022/03/02
LEFT関数 / RIGHT関数
No exerpt.
sh16ma
published in
🔍 BigQuery
@ Invalid date
LIMIT句 OFFSET句
No exerpt.
sh16ma
published in
🔍 BigQuery
@ 2022/09/28
LOWER関数
大文字を小文字に変換
sh16ma
published in
🔍 BigQuery
@ 2022/05/11
NULLIF関数
nullifは、故意にnull値を用いることができる。0除算時のエラー回避して、nullを返す。nullif()の中身で行われていることは、以下のcase式と同様。
sh16ma
published in
🔍 BigQuery
@ 2021/09/24
PARSE_DATE関数
文字型(STRING)の日付データを日付型(DATE)にしたい時に使える。selectparse_date('%Y %m %d', '20180101') -- 2018-01-01に変換される
sh16ma
published in
🔍 BigQuery
@ 2022/03/14
PERCENTAILE_CONT関数 / PERCENTAIL_DISC関数
percentile_cont|discwithin group(order by expression [(asc)|desc])over(partition by partition_list)
sh16ma
published in
🔍 BigQuery
@ 2022/11/15
PIVOT / UNPIVOT演算子
fromTABLEpivot(
sh16ma
published in
🔍 BigQuery
@ 2022/04/22
QUALIFY句
分析関数の結果をフィルタリング
sh16ma
published in
🔍 BigQuery
@ 2023/03/10
🔍
$ bq query --parameter='param::A' 'select @param'Waiting on bqjob_xxxx ... (0s) Current status: DONE
sh16ma
published in
🔍 BigQuery
@ 2021/09/12
ROW_NUMBER関数
レコードの連番を振りなおしたい時にも使える。
sh16ma
published in
🔍 BigQuery
@ 2022/04/11
SAFE_CAST関数
型変換なのだが、通常の'cast()'変換とは異なる。データ内に、string や Null を許容して一括変換してくれる。