SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Google BigQuery
Analytics 読書会#1
2014/08/13(Wed)
tagomoris
BigQueryと俺
2014/08/13(Wed)
tagomoris
appengine ja hackathon
#6 in 2010/07/31
kazunori -san says: 「BQまじすごい」
ペーパーを眺めてあーだこーだ言う
with @ashigeru 先生
COUNT(DISTINCT val) 問題
http://d.hatena.ne.jp/kazunori_279/20100527/1274950030
そして時は流れ
someday in Dec 2013
tagomoris:「なんか面白趣味プロダクトのネタないかな」
kazunori:「Fluentd BigQueryプラグインほしい!」
tagomoris:「ガタッ!」
fluent-plugin-bigquery爆誕
当初streaming insertのAPI制限がきつかった
buffer pluginも書いてカリカリチューン
fluent-plugin-buffer-lightening
今となってはだいぶ緩い
fluent-plugin-bigquery
メンテナ募集中!
閑話休題
Using the Command-Line Client
CLIも使えるよ
Pythonで書かれてるよ
コードが読めるのでBigQuery APIの使いか
たを学ぶのにもちょうべんり
Install and Setup (1)
Pythonは予め入れておけ、2.7だぞ
BigQuery clientのコードはGoogle codeにある
Google Cloud SDKにBigQuery clientも入って
るのでインストールはそっちから
本のAppEngineコードも試したければ言語にあ
わせたAppEngine SDKも入れよう
Install and Setup (2)
入れたらとりあえずGoogleアカウント認証
gcloud auth login
ブラウザでOAuth認証
実行端末に認証情報が保存される
project id の入力
Install and Setup (3)
権限は好きなときにrevokeできるよ
Webブラウザで
PC単位でなら: gcloud auth revoke
プロジェクト単位なら: gcloud config set
project <project_id>
複数project持ってるならデフォルトを選ぶこ
と
ここで一句
“gcloud components update” まじうざい
Using the Client (1)
bq と打てば何ができるかわかる、超べんり
bq [global flags] <command> [command flags]
[command argument]
bq --help と打てばオプションリストが出る、
超べんり
bq help <command> でヘルプが出る、最高
Using the Client (2)
bq ls コマンドで何があるかわかる、べんり
project id list: bq ls -p
datasets list: bq ls
tables list: bq ls <dataset_name>
recent job list: bq ls -j
--format で整形できる、まじべんり
Using the Client (3)
CLIだとprojectの違うアクセス設定されている
datasetとかが表示できない
でも名前がわかってれば中身は見られる
bq ls publicdata:samples
この本の後のほうで残りのコマンドも試すよ
Service Account Access (1)
Google個人アカウントじゃなくてService
Accountというやつも使えるよ
private keyだけで認証できる、べんり
サンプルコードとか自分で書いたコードを実
行するときにとくにべんり
Service Account Access (2)
$HOME/.bigqueryrc にGoogleアカウント設定
がある(ある?)
このファイルはCLI global flagsのリスト
CLIでの指定は設定ファイルのを上書きする
Service Account Access (3)
Service Account設定は別ファイルに作る
<service-account-id>@developer.gserviceaccount.com
$HOME/.bigquery.<service-account-id>
service_account = <service-account-id>@...
service_account_credential_file = TOKEN_PATH
service_account_private_key_file = PKEY_PATH
project_id = PROJECT_ID
Service Account Access (4)
この章のダウンロードコンテンツ:
設定ファイル作成用便利スクリプト
(以下省略、はいはい便利便利)
python-setuptools / pip を忘れるな!
Service Account Access (5)
bq --bigqueryrc=$HOME/.bigqueryrc.foo ls
なんか言われたら easy_install pyOpenSSl
It’s not typo
system pythonに入れられなかったら
PYTHONPATH
export $BIGQUERYRC=PATH もちょうべんり
おしまい

Más contenido relacionado

Más de SATOSHI TAGOMORI

Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubySATOSHI TAGOMORI
 
Lock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive OperationsLock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive OperationsSATOSHI TAGOMORI
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the WorldSATOSHI TAGOMORI
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamSATOSHI TAGOMORI
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessSATOSHI TAGOMORI
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage SystemsSATOSHI TAGOMORI
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd SeasonSATOSHI TAGOMORI
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToSATOSHI TAGOMORI
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersSATOSHI TAGOMORI
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In RubySATOSHI TAGOMORI
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldSATOSHI TAGOMORI
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceSATOSHI TAGOMORI
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and ThenSATOSHI TAGOMORI
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra PerfectSATOSHI TAGOMORI
 
Distributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraDistributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraSATOSHI TAGOMORI
 
Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"SATOSHI TAGOMORI
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsSATOSHI TAGOMORI
 
Overview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data ServiceOverview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data ServiceSATOSHI TAGOMORI
 
Hive dirty/beautiful hacks in TD
Hive dirty/beautiful hacks in TDHive dirty/beautiful hacks in TD
Hive dirty/beautiful hacks in TDSATOSHI TAGOMORI
 

Más de SATOSHI TAGOMORI (20)

Hijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in RubyHijacking Ruby Syntax in Ruby
Hijacking Ruby Syntax in Ruby
 
Lock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive OperationsLock, Concurrency and Throughput of Exclusive Operations
Lock, Concurrency and Throughput of Exclusive Operations
 
Data Processing and Ruby in the World
Data Processing and Ruby in the WorldData Processing and Ruby in the World
Data Processing and Ruby in the World
 
Planet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: BigdamPlanet-scale Data Ingestion Pipeline: Bigdam
Planet-scale Data Ingestion Pipeline: Bigdam
 
Technologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise BusinessTechnologies, Data Analytics Service and Enterprise Business
Technologies, Data Analytics Service and Enterprise Business
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Perfect Norikra 2nd Season
Perfect Norikra 2nd SeasonPerfect Norikra 2nd Season
Perfect Norikra 2nd Season
 
Fluentd 101
Fluentd 101Fluentd 101
Fluentd 101
 
To Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT ToTo Have Own Data Analytics Platform, Or NOT To
To Have Own Data Analytics Platform, Or NOT To
 
The Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and ContainersThe Patterns of Distributed Logging and Containers
The Patterns of Distributed Logging and Containers
 
How To Write Middleware In Ruby
How To Write Middleware In RubyHow To Write Middleware In Ruby
How To Write Middleware In Ruby
 
Modern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real WorldModern Black Mages Fighting in the Real World
Modern Black Mages Fighting in the Real World
 
Open Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud ServiceOpen Source Software, Distributed Systems, Database as a Cloud Service
Open Source Software, Distributed Systems, Database as a Cloud Service
 
Fluentd Overview, Now and Then
Fluentd Overview, Now and ThenFluentd Overview, Now and Then
Fluentd Overview, Now and Then
 
How to Make Norikra Perfect
How to Make Norikra PerfectHow to Make Norikra Perfect
How to Make Norikra Perfect
 
Distributed Logging Architecture in Container Era
Distributed Logging Architecture in Container EraDistributed Logging Architecture in Container Era
Distributed Logging Architecture in Container Era
 
Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"Fighting API Compatibility On Fluentd Using "Black Magic"
Fighting API Compatibility On Fluentd Using "Black Magic"
 
Fluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API DetailsFluentd v0.14 Plugin API Details
Fluentd v0.14 Plugin API Details
 
Overview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data ServiceOverview of data analytics service: Treasure Data Service
Overview of data analytics service: Treasure Data Service
 
Hive dirty/beautiful hacks in TD
Hive dirty/beautiful hacks in TDHive dirty/beautiful hacks in TD
Hive dirty/beautiful hacks in TD
 

Último

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 

Último (10)

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 

BigQuery読書会#1資料

  • 3. appengine ja hackathon #6 in 2010/07/31 kazunori -san says: 「BQまじすごい」 ペーパーを眺めてあーだこーだ言う with @ashigeru 先生 COUNT(DISTINCT val) 問題 http://d.hatena.ne.jp/kazunori_279/20100527/1274950030
  • 5. someday in Dec 2013 tagomoris:「なんか面白趣味プロダクトのネタないかな」 kazunori:「Fluentd BigQueryプラグインほしい!」 tagomoris:「ガタッ!」
  • 9. Using the Command-Line Client CLIも使えるよ Pythonで書かれてるよ コードが読めるのでBigQuery APIの使いか たを学ぶのにもちょうべんり
  • 10. Install and Setup (1) Pythonは予め入れておけ、2.7だぞ BigQuery clientのコードはGoogle codeにある Google Cloud SDKにBigQuery clientも入って るのでインストールはそっちから 本のAppEngineコードも試したければ言語にあ わせたAppEngine SDKも入れよう
  • 11. Install and Setup (2) 入れたらとりあえずGoogleアカウント認証 gcloud auth login ブラウザでOAuth認証 実行端末に認証情報が保存される project id の入力
  • 12. Install and Setup (3) 権限は好きなときにrevokeできるよ Webブラウザで PC単位でなら: gcloud auth revoke プロジェクト単位なら: gcloud config set project <project_id> 複数project持ってるならデフォルトを選ぶこ と
  • 14. Using the Client (1) bq と打てば何ができるかわかる、超べんり bq [global flags] <command> [command flags] [command argument] bq --help と打てばオプションリストが出る、 超べんり bq help <command> でヘルプが出る、最高
  • 15. Using the Client (2) bq ls コマンドで何があるかわかる、べんり project id list: bq ls -p datasets list: bq ls tables list: bq ls <dataset_name> recent job list: bq ls -j --format で整形できる、まじべんり
  • 16. Using the Client (3) CLIだとprojectの違うアクセス設定されている datasetとかが表示できない でも名前がわかってれば中身は見られる bq ls publicdata:samples この本の後のほうで残りのコマンドも試すよ
  • 17. Service Account Access (1) Google個人アカウントじゃなくてService Accountというやつも使えるよ private keyだけで認証できる、べんり サンプルコードとか自分で書いたコードを実 行するときにとくにべんり
  • 18. Service Account Access (2) $HOME/.bigqueryrc にGoogleアカウント設定 がある(ある?) このファイルはCLI global flagsのリスト CLIでの指定は設定ファイルのを上書きする
  • 19. Service Account Access (3) Service Account設定は別ファイルに作る <service-account-id>@developer.gserviceaccount.com $HOME/.bigquery.<service-account-id> service_account = <service-account-id>@... service_account_credential_file = TOKEN_PATH service_account_private_key_file = PKEY_PATH project_id = PROJECT_ID
  • 20. Service Account Access (4) この章のダウンロードコンテンツ: 設定ファイル作成用便利スクリプト (以下省略、はいはい便利便利) python-setuptools / pip を忘れるな!
  • 21. Service Account Access (5) bq --bigqueryrc=$HOME/.bigqueryrc.foo ls なんか言われたら easy_install pyOpenSSl It’s not typo system pythonに入れられなかったら PYTHONPATH export $BIGQUERYRC=PATH もちょうべんり