13
13

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 5 years have passed since last update.

Pentaho Data IntegrationでGoogle BigQueryに接続

Posted at

目的

  • BigQueryのデータをPentaho Data Integration(PDI)で取り込む
  • Google アナリティクスプレミアム(GAP)によるBigQueryエクスポートを想定しているが、他の用途にも応用できる(と思う)。

参考

作業手順

GAP - BigQueryエクスポートのテスト環境を構築

下記に従ってBigQueryプロジェクトを作成し、GAのサンプルデータを準備する

認証情報の準備

Google Developer Consoleにてサービスアカウントを作成して認証ファイルをダウンロードしておく
-- JDBCURL - starschema-bigquery-jdbc - JDBC URL settings - Starschema BigQuery JDBC Driver - Google Project Hosting

PDIコミュニティ版のダウンロード

追加クラスのインストール

ダウンロードページから次のファイルをダウンロード

bqjdbc-1.4-standalone.jar

  • PDIのlibディレクトリに入れる(libextだと動かなかった)

dependencies_for_kettle.zip

  • 解凍したファイルをPDIの「data-integration\libswt\win32(もしくはwin64)」に入れる

データコネクションの準備

新しいデータソースの追加

image

コネクションを新規作成

image

データベース接続の設定

image

フィールド 設定値
接続名 任意
接続タイプ Generic database
Custom Connection URL jdbc:BQDriver:<<プロジェクトIDをURLデコード>>?withServiceAccount=true
Custom Driver Class name net.starschema.clouddb.jdbc.BQDriver
ユーザ名 サービスアカウントのメールアドレス(クライアントIDではない)
パスワード ダウンロードしたキーファイルへのパス(日本語を含まない方が吉)

クエリーの実行

  • データを取得したいSQLを指定してプレビューを実行
13
13
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
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?