bricolage 5.22.2 → 5.22.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/jobclass/insert.rb +6 -4
- data/jobclass/load.rb +41 -8
- data/lib/bricolage/version.rb +1 -1
- data/test/home/Gemfile.lock +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 888f08c5389eb2cd139787f0d1e5953dffb4ba73
|
4
|
+
data.tar.gz: 4a6ef9137c4e5ac55976e9a4620a8b407294563b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7467cfe78a919f20a07555bd67c7088faf3bfa9b40e2fa3240644bbf7d69fb87fb6a65c41152ea3ffa978a54625efca08b1b829522ed117c85368303a2148c8
|
7
|
+
data.tar.gz: 90fdf06402e01edee7f53302c97ac43ebe47f8684b806372d818188fb6c4f8d64378b8025f3b1b74af70f85ed7bc6a35c4d153accd609306f529af0ef73037b0
|
data/jobclass/insert.rb
CHANGED
@@ -23,11 +23,13 @@ JobClass.define('insert') {
|
|
23
23
|
script {|params, script|
|
24
24
|
script.task(params['data-source']) {|task|
|
25
25
|
task.truncate_if params['truncate']
|
26
|
-
task.
|
27
|
-
|
28
|
-
|
26
|
+
task.transaction {
|
27
|
+
task.drop_force_if params['drop']
|
28
|
+
task.exec params['table-def'] if params['table-def']
|
29
|
+
task.exec params['sql-file']
|
30
|
+
task.analyze_if params['analyze']
|
31
|
+
}
|
29
32
|
task.vacuum_if params['vacuum'], params['vacuum-sort']
|
30
|
-
task.analyze_if params['analyze']
|
31
33
|
}
|
32
34
|
}
|
33
35
|
}
|
data/jobclass/load.rb
CHANGED
@@ -26,14 +26,47 @@ JobClass.define('load') {
|
|
26
26
|
|
27
27
|
script {|params, script|
|
28
28
|
script.task(params['dest-ds']) {|task|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
if params['drop']
|
30
|
+
# drop - create - load pattern
|
31
|
+
unless params['table-def']
|
32
|
+
raise ParameterError, "--table-def is required when --drop is enabled"
|
33
|
+
end
|
34
|
+
|
35
|
+
task.transaction {
|
36
|
+
task.drop_force '${dest_table}'
|
37
|
+
task.exec params['table-def']
|
38
|
+
task.load params['src-ds'], params['src-file'], params['dest-table'],
|
39
|
+
params['format'], params['jsonpath'], params['options']
|
40
|
+
task.grant_if params['grant'], params['dest-table']
|
41
|
+
}
|
42
|
+
# ANALYZE, VACUUM is needless for newly loaded table, skip always.
|
43
|
+
|
44
|
+
elsif params['truncate']
|
45
|
+
# truncate - load pattern
|
46
|
+
if params['drop'] or params['table-def']
|
47
|
+
raise ParameterError, "--truncate and --drop/--table-def is exclusive"
|
48
|
+
end
|
49
|
+
|
50
|
+
task.truncate_if params['truncate']
|
51
|
+
task.transaction {
|
52
|
+
task.load params['src-ds'], params['src-file'], params['dest-table'],
|
53
|
+
params['format'], params['jsonpath'], params['options']
|
54
|
+
task.grant_if params['grant'], params['dest-table']
|
55
|
+
}
|
56
|
+
# ANALYZE, VACUUM is needless for newly loaded table, skip always.
|
57
|
+
|
58
|
+
else
|
59
|
+
# load only pattern
|
60
|
+
|
61
|
+
task.transaction {
|
62
|
+
task.load params['src-ds'], params['src-file'], params['dest-table'],
|
63
|
+
params['format'], params['jsonpath'], params['options']
|
64
|
+
task.grant_if params['grant'], params['dest-table']
|
65
|
+
task.analyze_if params['analyze']
|
66
|
+
}
|
67
|
+
# We cannot execute VACUUM in transaction
|
68
|
+
task.vacuum_if params['vacuum'], params['vacuum-sort']
|
69
|
+
end
|
37
70
|
}
|
38
71
|
}
|
39
72
|
}
|
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.22.
|
4
|
+
version: 5.22.3
|
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-
|
11
|
+
date: 2017-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
version: '0'
|
301
301
|
requirements: []
|
302
302
|
rubyforge_project:
|
303
|
-
rubygems_version: 2.
|
303
|
+
rubygems_version: 2.6.8
|
304
304
|
signing_key:
|
305
305
|
specification_version: 4
|
306
306
|
summary: SQL Batch Framework
|