bricolage 5.23.0 → 5.23.1

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: 68aff8b010487891f214258a2c0b3e4c175e9195
4
- data.tar.gz: c9cf9a4ee6d938e7b05456a0643a687094cc379a
3
+ metadata.gz: 8a460416e7ef2fb18814d325a89d9107916a2741
4
+ data.tar.gz: b2f0be30fee48a26dc1b6064b47b4039829a9e95
5
5
  SHA512:
6
- metadata.gz: 3c923cd19ed97f203a12e090efafd55edfbe79f2807cd739e92704d1788caa45bebe074c56ce156276ee0af69fbf9cbfcbb7b0a25bdcb73068c93d9df8b5aed3
7
- data.tar.gz: 25d863da9ce8fb1f0d380f4fe9ce80cbe8f9201fc82ca1ad3fe49259453f6a12325723254884ac87b77b0a22da5c8856c0cb10332539e7832fa5ebffc1b01c92
6
+ metadata.gz: 15018c00f2be9725375fc7f97ac9f5ef42f3dd6af39a4afc3cdb740bb2ef287ce4541bad920d8a78b13d275b3cede650dab737c14c09f12d577ca937c157504d
7
+ data.tar.gz: 80dae05f2fcfebab99363c2c42e533e732454e5585ce45b8944da403ab2e497a014e41bd6199aeb2207baf57bbb94b8e8924ad93b386947dfdf68b345e419429
@@ -27,6 +27,7 @@ class StreamingLoadJobClass < RubyJobClass
27
27
  params.add Bricolage::OptionalBoolParam.new('noop', 'Does not change any data.')
28
28
  params.add Bricolage::OptionalBoolParam.new('load-only', 'Just issues COPY statement to work table and quit. No INSERT, no dequeue, no load log.')
29
29
  params.add Bricolage::OptionalBoolParam.new('dequeue-only', 'Dequeues already loaded files.')
30
+ params.add Bricolage::OptionalBoolParam.new('skip-work', 'Skip work table and load directly into dest-table')
30
31
  end
31
32
 
32
33
  def StreamingLoadJobClass.declarations(params)
@@ -71,7 +72,8 @@ class StreamingLoadJobClass < RubyJobClass
71
72
  sql: params['sql-file'],
72
73
  logger: ds.logger,
73
74
  noop: params['noop'],
74
- load_only: params['load-only']
75
+ load_only: params['load-only'],
76
+ skip_work: params['skip-work']
75
77
  )
76
78
  end
77
79
 
@@ -95,7 +97,7 @@ class StreamingLoadJobClass < RubyJobClass
95
97
  def initialize(data_source:, queue:, keep_ctl:,
96
98
  table:, work_table: nil, log_table: nil, load_options: nil,
97
99
  sql: nil,
98
- logger:, noop: false, load_only: false)
100
+ logger:, noop: false, load_only: false, skip_work: false)
99
101
  @ds = data_source
100
102
  @src = queue
101
103
  @keep_ctl = keep_ctl
@@ -107,6 +109,7 @@ class StreamingLoadJobClass < RubyJobClass
107
109
  @logger = logger
108
110
  @noop = noop
109
111
  @load_only = load_only
112
+ @skip_work = skip_work
110
113
 
111
114
  @start_time = Time.now
112
115
  @end_time = nil
@@ -159,7 +162,7 @@ class StreamingLoadJobClass < RubyJobClass
159
162
  end
160
163
  create_load_log_file(objects) {|log_url|
161
164
  @ds.open {|conn|
162
- execute_update conn, "truncate #{work_table}"
165
+ execute_update conn, "truncate #{work_table}" unless @skip_work
163
166
  conn.transaction {|txn|
164
167
  execute_update conn, "delete #{log_table_wk}"
165
168
  execute_update conn, load_log_copy_stmt(log_table_wk, log_url, @src.credential_string)
@@ -174,10 +177,11 @@ class StreamingLoadJobClass < RubyJobClass
174
177
  txn.truncate_and_commit log_table_wk
175
178
  else
176
179
  create_manifest_file(not_loaded) {|manifest_url|
177
- execute_update conn, manifest_copy_stmt(work_table, manifest_url)
180
+ dest_table = @skip_work ? @table : work_table
181
+ execute_update conn, manifest_copy_stmt(dest_table, manifest_url)
178
182
  @logger.info "load succeeded: #{manifest_url}" unless @noop
179
183
  unless @load_only
180
- commit_work_table conn, work_table
184
+ commit_work_table conn, work_table unless @skip_work
181
185
  commit_load_log conn, log_table_wk
182
186
  end
183
187
  txn.truncate_and_commit log_table_wk
@@ -1,4 +1,4 @@
1
1
  module Bricolage
2
2
  APPLICATION_NAME = 'Bricolage'
3
- VERSION = '5.23.0'
3
+ VERSION = '5.23.1'
4
4
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- bricolage (5.23.0)
4
+ bricolage (5.23.1)
5
5
  aws-sdk (~> 2)
6
6
  mysql2
7
7
  pg (~> 0.18.0)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bricolage
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.23.0
4
+ version: 5.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg