fluent-plugin-bigquery 0.3.3 → 0.3.4

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: 66cdf151a1711b82f972e108d736638c017637ca
4
- data.tar.gz: 29de9f545e896319d26105753a8569a60d411441
3
+ metadata.gz: 3b4f46435678df7e2b883e2dfdbb0a77a9359481
4
+ data.tar.gz: 7cbe9b3aa6e4c22ccf0299bfd0a8ff8d1892ccff
5
5
  SHA512:
6
- metadata.gz: 3e413ccab59cb232dae2b2808bb4637df291eb96a0540a98387aff8397a0fb39b0f7585c6c0d565d6f2d5851b516737e7308deb9c11572a303af55832f49cd13
7
- data.tar.gz: f7fdfa22e82ff9f5748782e8b62429c005467bfec9ff3ea0133b2cd53f71359d90789275d42859b96f2d583830a1a6160916a0452ad9efa5a57c559fe07af366
6
+ metadata.gz: b3e02368662e2c7448726d9d3652aa80d60cd19a040122cfdd05aed6b36949e2c5b760cc3812f690633e4ad3685fd01da14eacab65066caa18e754b8432e7dde
7
+ data.tar.gz: b9d5c81042fe958b6230d9ebffbf6c09526d7f7bdb0b2641667e2c7c34ab70418d03542a23bb90bff23e565315f7c1e6817ba792b1e622d94d015bad6eea4ef0
data/.travis.yml CHANGED
@@ -4,7 +4,18 @@ rvm:
4
4
  - 2.0
5
5
  - 2.1
6
6
  - 2.2
7
- - 2.3.0
7
+ - 2.3.3
8
+
9
+ gemfile:
10
+ - Gemfile
11
+ - gemfiles/activesupport-4.gemfile
12
+
13
+ matrix:
14
+ exclude:
15
+ - rvm: 2.0
16
+ gemfile: Gemfile
17
+ - rvm: 2.1
18
+ gemfile: Gemfile
8
19
 
9
20
  before_install:
10
21
  - gem update bundler
data/README.md CHANGED
@@ -14,6 +14,9 @@
14
14
  Current version of this plugin supports Google API with Service Account Authentication, but does not support
15
15
  OAuth flow for installed applications.
16
16
 
17
+ ## Notice
18
+ If you use ruby-2.1 or earlier, you must use activesupport-4.2.x or earlier.
19
+
17
20
  ## Configuration
18
21
 
19
22
  ### Options
@@ -20,13 +20,13 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "rake"
22
22
  spec.add_development_dependency "rr"
23
- spec.add_development_dependency "test-unit", "~> 3.0.2"
24
- spec.add_development_dependency "test-unit-rr", "~> 1.0.3"
23
+ spec.add_development_dependency "test-unit"
24
+ spec.add_development_dependency "test-unit-rr"
25
25
 
26
26
  spec.add_runtime_dependency "google-api-client", "~> 0.9.3"
27
27
  spec.add_runtime_dependency "googleauth", ">= 0.5.0"
28
28
  spec.add_runtime_dependency "multi_json"
29
- spec.add_runtime_dependency "activesupport", ">= 3.2", "< 5"
29
+ spec.add_runtime_dependency "activesupport", ">= 3.2", "< 6"
30
30
  spec.add_runtime_dependency "fluentd", "~> 0.12.0"
31
31
  spec.add_runtime_dependency "fluent-mixin-plaintextformatter", '>= 0.2.1'
32
32
  spec.add_runtime_dependency "fluent-mixin-config-placeholders", ">= 0.3.0"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'activesupport', '< 5'
4
+
5
+ # Specify your gem's dependencies in fluent-plugin-bigquery.gemspec
6
+ gemspec :path => '../'
@@ -1,5 +1,5 @@
1
1
  module Fluent
2
2
  module BigQueryPlugin
3
- VERSION = "0.3.3".freeze
3
+ VERSION = "0.3.4".freeze
4
4
  end
5
5
  end
@@ -25,6 +25,7 @@ module Fluent
25
25
  create_table_retry_limit = 3
26
26
  create_table_retry_wait = 1
27
27
  create_table_retry_count = 0
28
+ table_id = safe_table_id(table_id)
28
29
 
29
30
  begin
30
31
  definition = {
@@ -93,7 +94,7 @@ module Fluent
93
94
  options: {timeout_sec: timeout_sec, open_timeout_sec: open_timeout_sec}
94
95
  })
95
96
  log.debug "insert rows", project_id: project, dataset: dataset, table: table_id, count: rows.size
96
- log.warn "insert errors", insert_errors: res.insert_errors.to_s if res.insert_errors && !res.insert_errors.empty?
97
+ log.warn "insert errors", project_id: project, dataset: dataset, table: table_id, insert_errors: res.insert_errors.to_s if res.insert_errors && !res.insert_errors.empty?
97
98
  rescue Google::Apis::ServerError, Google::Apis::ClientError, Google::Apis::AuthorizationError => e
98
99
  @client = nil
99
100
 
@@ -254,6 +255,10 @@ module Fluent
254
255
  def get_auth_from_application_default
255
256
  Google::Auth.get_application_default([@scope])
256
257
  end
258
+
259
+ def safe_table_id(table_id)
260
+ table_id.gsub(/\$\d+$/, "")
261
+ end
257
262
  end
258
263
  end
259
264
  end
@@ -434,6 +434,10 @@ module Fluent
434
434
  record = replace_record_key(record)
435
435
  end
436
436
 
437
+ if @convert_hash_to_json
438
+ record = convert_hash_to_json(record)
439
+ end
440
+
437
441
  buf = String.new
438
442
  row = @fields.format(@add_time_field.call(record, time))
439
443
  unless row.empty?
data/test/helper.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'rubygems'
2
1
  require 'bundler'
3
2
  begin
4
3
  Bundler.setup(:default, :development)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-bigquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoya Ito
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-11-15 00:00:00.000000000 Z
12
+ date: 2016-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -43,30 +43,30 @@ dependencies:
43
43
  name: test-unit
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 3.0.2
48
+ version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 3.0.2
55
+ version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: test-unit-rr
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.0.3
62
+ version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 1.0.3
69
+ version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: google-api-client
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -118,7 +118,7 @@ dependencies:
118
118
  version: '3.2'
119
119
  - - "<"
120
120
  - !ruby/object:Gem::Version
121
- version: '5'
121
+ version: '6'
122
122
  type: :runtime
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ dependencies:
128
128
  version: '3.2'
129
129
  - - "<"
130
130
  - !ruby/object:Gem::Version
131
- version: '5'
131
+ version: '6'
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: fluentd
134
134
  requirement: !ruby/object:Gem::Requirement
@@ -201,6 +201,7 @@ files:
201
201
  - README.md
202
202
  - Rakefile
203
203
  - fluent-plugin-bigquery.gemspec
204
+ - gemfiles/activesupport-4.gemfile
204
205
  - lib/fluent/plugin/bigquery/errors.rb
205
206
  - lib/fluent/plugin/bigquery/schema.rb
206
207
  - lib/fluent/plugin/bigquery/version.rb
@@ -232,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
233
  version: '0'
233
234
  requirements: []
234
235
  rubyforge_project:
235
- rubygems_version: 2.6.4
236
+ rubygems_version: 2.6.8
236
237
  signing_key:
237
238
  specification_version: 4
238
239
  summary: Fluentd plugin to store data on Google BigQuery