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 +4 -4
- data/jobclass/streaming_load.rb +9 -5
- data/lib/bricolage/version.rb +1 -1
- data/test/home/Gemfile.lock +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a460416e7ef2fb18814d325a89d9107916a2741
|
4
|
+
data.tar.gz: b2f0be30fee48a26dc1b6064b47b4039829a9e95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15018c00f2be9725375fc7f97ac9f5ef42f3dd6af39a4afc3cdb740bb2ef287ce4541bad920d8a78b13d275b3cede650dab737c14c09f12d577ca937c157504d
|
7
|
+
data.tar.gz: 80dae05f2fcfebab99363c2c42e533e732454e5585ce45b8944da403ab2e497a014e41bd6199aeb2207baf57bbb94b8e8924ad93b386947dfdf68b345e419429
|
data/jobclass/streaming_load.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/bricolage/version.rb
CHANGED
data/test/home/Gemfile.lock
CHANGED
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.
|
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-
|
11
|
+
date: 2017-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|