Skip to content

Instantly share code, notes, and snippets.

View sakama's full-sized avatar
🎯
🍺

Satoshi Akama sakama

🎯
🍺
  • Treasure Data
  • Tokyo, Japan
View GitHub Profile
@sakama
sakama / TestHogeOutputPlugin.java
Created September 11, 2019 05:39
Embulk Output Pluginのテスト
package org.embulk.output.hoge;
import okhttp3.mockwebserver.MockWebServer;
import org.embulk.spi.OutputPlugin;
import org.embulk.test.TestingEmbulk;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@sakama
sakama / diff.java
Created September 3, 2019 08:29
How to check diff
public final class Test {
public Test(String hoge) {
}
}
@sakama
sakama / build.sh
Created December 4, 2017 06:50
embulk-input-marketoのビルド手順
$ git clone [email protected]:treasure-data/embulk-input-marketo.git
$ cd embulk-input-marketo
$ ./gradlew gem
$ cd /path/to/config.yml
$ embulk run -I /path/to/embulk-input-marketo/lib config.yml
@sakama
sakama / bigquery_table_get.json
Created October 11, 2017 04:15
BigQuery API Tables:get
{
"kind": "bigquery#table",
"etag": "\"ABCDEFGHIJKLMNOPQRSTU\"",
"id": "abcdefg:demodatasets.demotable",
"selfLink": "https://www.googleapis.com/bigquery/v2/projects/vibrant-grammar-856/datasets/demodatasets/tables/demotable",
"tableReference": {
"projectId": "abcdefg",
"datasetId": "demodatasets",
"tableId": "demotable"
},
@sakama
sakama / embulk-output-td_failure.md
Created June 23, 2017 09:16
embulk-output-td fialure
$ embulk run -I ~/data/embulk-output-td/lib gcs_td.yml
2017-06-23 18:14:44.697 +0900: Embulk v0.8.25
2017-06-23 18:14:57.034 +0900 [INFO] (0001:transaction): Loaded plugin embulk-input-gcs (0.2.3)
2017-06-23 18:14:57.102 +0900 [INFO] (0001:transaction): Loaded plugin embulk/output/td from a load path
2017-06-23 18:14:59.183 +0900 [INFO] (0001:transaction): Using local thread executor with max_threads=8 / output tasks 4 = input tasks 2 * 2
2017-06-23 18:14:59.238 +0900 [INFO] (0001:transaction): td-client version: 0.7.37
2017-06-23 18:14:59.242 +0900 [INFO] (0001:transaction): Reading configuration file: /Users/someone/.td/td.conf
org.embulk.exec.PartialExecutionException: java.lang.NoClassDefFoundError: com/fasterxml/jackson/datatype/jsonorg/JsonOrgModule
	at org.embulk.exec.BulkLoader$LoaderState.buildPartialExecuteException(org/embulk/exec/BulkLoader.java:375)
@sakama
sakama / lt_title.md
Last active May 16, 2017 12:46
20170516 Embulk meetup #3 LTタイトル

Embulk Meetup #3 LTタイトル(各5〜maxで10分予定)

https://eventdots.jp/event/618872

  • EmbulkでMySQLからBigQueryへ1000個のテーブルをコピーした話 by @kazukgw
  • MySQLからBigQueryの同期を差分更新にしたら4倍高速になった話 by 塩﨑健弘
  • とあるマーケティング部隊でのembulkの活用事例 by @grimrose
  • embulk-input-redashを作ってみた @ariarijp
  • Embulkを利用した開発でちょっと困ったこと by @katsuyan121
  • Embulk資料集の紹介 @hiroysato
@sakama
sakama / embulk-input-mongodb_investigate.md
Last active June 16, 2016 08:15
embulk-input-mongodbの型調査

##Example Data

> db.version();
3.0.10

> db.test.find();
{
  "_id" : ObjectId("573a9d37efb32df843124db9"),
  "account" : 32864,
  "time" : ISODate("2015-01-25T13:23:15Z"),
@sakama
sakama / getFieldSchema.java
Created May 20, 2016 09:01
ダミーのスキーマを作る
private Schema getFieldSchema() {
ImmutableList.Builder<Column> columns = ImmutableList.builder();
columns.add(new Column(0, "record", Types.JSON));
return new Schema(columns.build());
}
@sakama
sakama / feedback.md
Last active December 16, 2015 07:44
フィードバック

もろもろフィードバック

embulk-output-ncmbへのフィードバック

まずgit clone後に./gradlew gemコマンドでビルドして生成されたgemをembulk runしてもParticalExecutionExceptionが発生して動作しないです。 git cloneしただけの状態でembulk runすると動作するので何かgit add漏れがあると思います。

ちなみに開発中は都度gem installをしなくても以下のコマンドで実行可能です。

@sakama
sakama / download_from_gcs.rb
Last active November 4, 2015 01:08
Download objects from Google Cloud Storage using Google API Client Libraries for Ruby
client = Google::APIClient.new(
application_name: "hoge"
)
storage = client.discovered_api("storage", "v1")
scopes = ["https://www.googleapis.com/auth/devstorage.read_write"]
auth = Google::Auth::ServiceAccountCredentials.new(
json_key_io: StringIO.new(json_keyfile),
scope: scopes
)
auth.fetch_access_token!