embulk-output-bigquery 0.3.0.pre1 → 0.3.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0907e6f02a9b05ea6a75e18d457cb641eede5973
4
- data.tar.gz: f8119467b434636fc6f6696c36f2075eeb82e795
3
+ metadata.gz: 6d94d238ce16c412168d14a2d598c4858c2517a1
4
+ data.tar.gz: 98c6a413ce767acc0db2a1b4b6fa8f1f43f1d7db
5
5
  SHA512:
6
- metadata.gz: 4b7313ca411cc3bb1fd064554ac706219e00fb358a445e2978e918c417aacc96ee972d3d49d30e9c1ebdb286066af4cf18305846fdf4dab06a1ced91249af2dc
7
- data.tar.gz: 2f9e84d736de70a35369b4a003d8c1848a1433da902843d57b89a8b5ff5eb64bb945fceb828af2f565b87c271b9537dc433d53a6a1024c4ea014f74842abc0e1
6
+ metadata.gz: d5aee1620e2171c7ca84101c196bb85015bd53d1a5816949353e3e921559dcc96211a81c1c9d6a35a563de2c4656ed98c8b495577ba57d1a8e74e046bb9ab594
7
+ data.tar.gz: 50f32129feea6bb33c7574e0d7aa73e387e37ced9ebe5d96a550225de78bddb365ab603b490a0a8361b008f16332a1092e84c278cf25e21a168700b8a751023a
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  vendor/
7
7
  .ruby-version
8
8
  .tags
9
+ your-project-000.json
data/README.md CHANGED
@@ -337,7 +337,7 @@ out:
337
337
 
338
338
  ### Run example:
339
339
 
340
- Prepare a json\_keyfile at /tmp/your-project-000.json, then
340
+ Prepare a json\_keyfile at example/your-project-000.json, then
341
341
 
342
342
  ```
343
343
  $ embulk bundle install --path vendor/bundle
@@ -351,7 +351,7 @@ $ bundle exec rake test
351
351
  ```
352
352
 
353
353
  To run tests which actually connects to BigQuery such as test/test\_bigquery\_client.rb,
354
- prepare a json\_keyfile at /tmp/your-project-000.json, then
354
+ prepare a json\_keyfile at example/your-project-000.json, then
355
355
 
356
356
  ```
357
357
  $ CONNECT=1 bundle exec ruby test/test_bigquery_client.rb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-output-bigquery"
3
- spec.version = "0.3.0.pre1"
3
+ spec.version = "0.3.0.pre2"
4
4
  spec.authors = ["Satoshi Akama", "Naotoshi Seo"]
5
5
  spec.summary = "Google BigQuery output plugin for Embulk"
6
6
  spec.description = "Embulk plugin that insert records to Google BigQuery."
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: CSV
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: delete_in_advance
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  compression: GZIP
@@ -17,7 +17,7 @@ out:
17
17
  type: bigquery
18
18
  mode: replace
19
19
  auth_method: json_key
20
- json_keyfile: /tmp/your-project-000.json
20
+ json_keyfile: example/your-project-000.json
21
21
  dataset: your_dataset_name
22
22
  table: your_table_name
23
23
  compression: GZIP
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: CSV
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -19,7 +19,7 @@ out:
19
19
  type: bigquery
20
20
  mode: append
21
21
  auth_method: json_key
22
- json_keyfile: /tmp/your-project-000.json
22
+ json_keyfile: example/your-project-000.json
23
23
  dataset: your_dataset_name
24
24
  table: your_table_name
25
25
  compression: GZIP
@@ -19,7 +19,7 @@ out:
19
19
  type: bigquery
20
20
  mode: append_direct
21
21
  auth_method: json_key
22
- json_keyfile: /tmp/your-project-000.json
22
+ json_keyfile: example/your-project-000.json
23
23
  dataset: your_dataset_name
24
24
  table: your_table_name
25
25
  compression: GZIP
@@ -9,7 +9,7 @@ out:
9
9
  type: bigquery
10
10
  mode: replace
11
11
  auth_method: json_key
12
- json_keyfile: /tmp/your-project-000.json
12
+ json_keyfile: example/your-project-000.json
13
13
  dataset: your_dataset_name
14
14
  table: your_table_name
15
15
  compression: GZIP
@@ -9,7 +9,7 @@ out:
9
9
  type: bigquery
10
10
  mode: replace
11
11
  auth_method: json_key
12
- json_keyfile: /tmp/your-project-000.json
12
+ json_keyfile: example/your-project-000.json
13
13
  dataset: your_dataset_name
14
14
  table: your_table_name
15
15
  compression: GZIP
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace_backup
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  dataset_old: your_dataset_name_old
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name_%Y%m%d
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -9,7 +9,7 @@ out:
9
9
  type: bigquery
10
10
  mode: replace
11
11
  auth_method: json_key
12
- json_keyfile: /tmp/your-project-000.json
12
+ json_keyfile: example/your-project-000.json
13
13
  dataset: your_dataset_name
14
14
  table: your_table_name_%Y%m%d
15
15
  compression: GZIP
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
data/example/example.yml CHANGED
@@ -20,7 +20,7 @@ out:
20
20
  type: bigquery
21
21
  mode: replace
22
22
  auth_method: json_key
23
- json_keyfile: /tmp/your-project-000.json
23
+ json_keyfile: example/your-project-000.json
24
24
  dataset: your_dataset_name
25
25
  table: your_table_name
26
26
  source_format: NEWLINE_DELIMITED_JSON
@@ -26,7 +26,7 @@ module Embulk
26
26
  end
27
27
  end
28
28
 
29
- def self.configure(config, schema, processor_count)
29
+ def self.configure(config, schema, task_count)
30
30
  task = {
31
31
  'mode' => config.param('mode', :string, :default => 'append'),
32
32
  'auth_method' => config.param('auth_method', :string, :default => 'private_key'),
@@ -193,11 +193,11 @@ module Embulk
193
193
  unique_name = "%08x%08x%08x" % [Process.pid, now.tv_sec, now.tv_nsec]
194
194
 
195
195
  if %w[replace replace_backup append].include?(task['mode'])
196
- task['temp_table'] ||= "#{task['table']}_LOAD_TEMP_#{unique_name}"
196
+ task['temp_table'] ||= "LOAD_TEMP_#{unique_name}_#{task['table']}"
197
197
  end
198
198
 
199
199
  if task['with_rehearsal']
200
- task['rehearsal_table'] ||= "#{task['table']}_LOAD_REHEARSAL_#{unique_name}"
200
+ task['rehearsal_table'] ||= "LOAD_REHEARSAL_#{unique_name}_#{task['table']}"
201
201
  end
202
202
 
203
203
  task
@@ -230,8 +230,8 @@ module Embulk
230
230
  transaction_report
231
231
  end
232
232
 
233
- def self.transaction(config, schema, processor_count, &control)
234
- task = self.configure(config, schema, processor_count)
233
+ def self.transaction(config, schema, task_count, &control)
234
+ task = self.configure(config, schema, task_count)
235
235
 
236
236
  @task = task
237
237
  @schema = schema
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-output-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre1
4
+ version: 0.3.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Satoshi Akama
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-14 00:00:00.000000000 Z
12
+ date: 2016-03-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-api-client