データ分析のためのSQLが最速で身につく! データ分析のためのSQLが最速で身につく! 昨今では、ノンエンジニアのビジネスパーソンでも、CRMの顧客情報、EC・実店舗の注文ログ、Webサイトの行動ログなどの大量のデータを入手し、分析する機会が増えました。その結果、Excelだけでは集計・分析が困難になるケースも生まれています。 本書は、データの抽出・整形に用いられる言語「SQL」について、プログラミング未経験でも取り組める入門書です。Googleアカウントがあればすぐに利用でき、実務にもそのまま使える「BigQuery」をSQLの学習・実行環境として解説しています。 本書のゴールは、データ分析の実務に使えるSQLのスキルをマスターした状態です。そのため、初心者向けでありながら、難易度の高い「分析関数」(ウィンドウ関数)についても解説しています。データベースの管理やメンテナンスについては省き
I tried several csv-formats (different escape characters, quotes and other settings) to export data from MySQL and to import it into BigQuery, but I was not able to find a solution that works in every case. Google SQL requires the following Code for importing/exporting from/to MySQL. Although, Cloud SQL is not BigQuery, it is a good starting point: SELECT * INTO OUTFILE 'filename.csv' CHARACTER SE
タイムトラベルはじめました 〜時をかけるBigQuery〜 / Now serving Time Machine 〜BigQuery Which Leapt Through Time〜
注意 注: この記事の内容は古いです。IntelliJのバージョンが2021.1以上の人は以下の方法で接続したほうが良いです。 IntelliJ便利ですよね。 JavaのIDEとして有名ですが、その他にも様々な言語のIDEとしても使えますし、さらにはDBクライアントとしても優秀です。 対応しているDBの種類が豊富ですし、機能もリッチです。 ですが、BigQueryにはデフォルトで対応していないので、そこだけちょっと惜しいです。 この記事ではIntelliJ系のIDEからBigQueryに接続する方法を説明します。 参考にした手法とその問題点 IntelliJ BigQuery でGoogle検索すると以下の記事が最初に見つかります。 https://blog.jetbrains.com/datagrip/2018/07/10/using-bigquery-from-intellij-bas
久しぶりにペラペラな思いつきを書き捨てて、寝ます。 2、3年前ぐらいにSIerやコンサルでTreasure Dataとか使ってマネージドDWH作ろうぜっていう風潮が流行って、今は運用フェーズに入ってどこも結構苦しんでるってのが僕のすごく狭い観測範囲での印象。 AWSのReadshiftしかり。 なぜ苦しんでるかっていうと、言うほどスケールしないからであり、言うほどマネージドじゃないから。 Treasure Dataは基本的に割当メモリが固定でオートスケールしないので、ピーク時に合わせて必要なメモリを確保しておかないといけない。そうなるとメモリ使用量とか負荷とかをモニタリングしないといけないわけだけど、Saasだから内部のアーキテクチャが隠蔽されていていちいちサポートに問い合わせないといけなかったりする。 Redshiftの場合はそもそも自前でクラスタ管理しなくちゃいけないのでそれが大変って
Googleアナリティクスで収集しているデータ(メジャメントプロトコル)をBigQueryに送り、集計・可視化できるようにする。無料版のGAにも対応し、しかもサーバレスでシンプルに実装できる。 本来BigQueryを使ったウェブ行動の詳細分析はGA360を使うべきなのだが、限りなく低コストでこんなことができるという参考程度で紹介する。 通常無料版のGoogleアナリティクスではできないログベースの行動分析をするのに使ったり、有料版であったとしてもGAはどのようなトラフィックを除外して集計しているのか、Googlebotなどのクローラがどんな動きをしているのかなどを検証するのに使うといいかもしれない。 原理はGoogleアナリティクスのJavaScriptがGoogleの計測サーバに送っているパケットを自前のサーバに送ってログ化するというシンプルなものである。 従来はデータ収集用のサーバを構
13. 課金の対象 ストレージ - $0.020 per GB / month クエリ - $5 per TB processed (scanned) ストリーミングインサート - $0.01 per 100,000 rows until July 20, 2015. After July 20, 2015, $0.01 per 200 MB, with individual rows calculated using a 1 KB minimum size. 注目すべきはストレージ 14. 簡単な例 1TBのテーブルを毎日ロード、それぞれを一ヶ月間保持 日々のデータを毎日5回スキャンして集計 ストレージ : 1TB * 30 (tables) = $0.020 * 1000 * 30 = $600 クエリ: 1TB * 5 (Queries) * 30 (days) = $750
肋骨が折れたかもしれん。痛え。それは置いといて…BigQuery。処理能力を体感したかったのでとりあえずMySQLの本番データをつっこんだ。fluentdでログも突っ込んでるんだけど、そっちはデータが溜まってないからまだおもしろくないかな。それについてはまた別途。まあ、fluentdでデータ突っ込むのはいろんな人がqiitaとかブログに上げてるし書くまでもないかもしれないけどね。 0. 作業の流れ MySQLからダンプを抜く ダンプをCloud Storageにuploadする Cloud Storage からbigqueryにインポートする クエリ投げる という流れになる。この記事では深く言及しないが、Google Compute Platformのコンソールでプロジェクトの作成やら課金の登録やらが済んでいて、作業を行うマシンにはコマンドラインツールがインストール済みであるとする。 コマ
本書は、クラウド上でSQLを使ってビッグデータを解析するGoogle BigQueryについて包括的に解説する書籍です。Google BigQueryの使い方から内部動作、そしてBigQueryならではのSQLの活用法、サードパーティのツールとの連携までを詳しく解説します。また、BigQueryを支えるGoogleのインフラストラクチャについても総覧しており、現代最高の超巨大インフラストラクチャの姿を知ることができます。BigQueryの全体像をマスターできる本書は、ビッグデータをSQLで活用したいデータサイエンティスト、ソフトウェア開発者必携の一冊です。 訳者まえがき はじめに I部 BigQueryの基礎知識 1章 Googleにおけるビッグデータの物語 1.1 ビッグデータスタック 1.0 1.2 ビッグデータスタック 2.0(そしてその先にあるもの) 1.3 オープンソースのスタッ
Google BigQueryを使ってみようと思って、最近少し勉強している。Googleがホワイトペーパーを出していたので、読んでみた。(※2012年の文献) BigQuery についてのホワイトペーパーを公開しました - Google Developer Relations Japan Blog 以下、内容の簡単なメモ。 もともとGoogle社内で利用されていた Google社内で利用されてきた'Dremel'というサービスがある。巨大なデータに対してSQLライクなクエリを実行すると、数秒で結果が返ってくる。Googleでは、エンジニアだけでなくアナリストなど非エンジニアの人も利用している。 Dremelがベースとなり、外部に公開されたのがBig Query。フルマネージドなクラウドサービス。サードパーティの開発者は、REST APIやCLI, Web UIなどを利用してこのサービスにア
互いにGoogleのサービスです。 さて、この2つ。 2013年のGoogle I/Oで連携されると発表されて早1年。実際に使われているところをあまり聞いた事ないという人も多いのでは。 まぁ、これの使い方って社外秘だったりというところも多いのかなと思います。私自身もそんなにおおっぴらにお話しすることが出来なかったりなのですが、やんわり『こんな感じで使えるよ』ということをお話ししたいと思います。 コストがかかるようで、コスト削減。 アクセス解析基盤を作るのって結構面倒じゃないですか?うちも無いわけじゃなかったんですけど、正直チープでした。最初からアクセス解析を意識してシステムを設計して、構築されている素晴らしいものなら良いのですが、そうじゃない場合はユーザーを認識するためにプログラムを改修したり、様々なところからログを収集して、合体させたり非常に面倒なわけですよ。しかも、それをオンラインで色
まだ入門もしてないので「ことはじめ」じゃないです。 大体触ってみたのを載せます。 Wikipedia 集計 サンプルデータのwikipediaを集計してみました。 データは3億行ほどあり、サイズは36GBほどあります。 今回は、contributor_usernameを集計し、wikipediaに貢献している人ランキングをつくりました。 上位陣はbotさん達ですね。 結果としては、3億行のデータを、 何も考えずに書いて 16.2秒で集計することが出来ました。 3億行を16秒。 countしなければ3秒くらいで終わります。 MapReduceみたいなのを一切書いてないのにこの速度。 ちなみにテーブルはインデックスしているわけではなく毎回フルスキャンしているらしい。 わお。 データ保管: \$0.026/GB/mo クエリ: $5/TB (スキャンしたデータのサイズで課金) 今回のwikipe
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く