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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 421cba4c1e08c2f0a0e915b0ba98a6ab18a726ee
4
- data.tar.gz: 7458e51782caa425498889ff6e7db532707bc154
3
+ metadata.gz: 888f08c5389eb2cd139787f0d1e5953dffb4ba73
4
+ data.tar.gz: 4a6ef9137c4e5ac55976e9a4620a8b407294563b
5
5
  SHA512:
6
- metadata.gz: 359a1e98d6a75a5f4102b9ebe9478868cdcecbf6e3cc73856a53a83a722f879d72340f56e0dc10f8f82d3a5b1023d0b8bfb7d5a55e3a337847db4646980d0984
7
- data.tar.gz: 05b59b3de45b25baa445391d710786fd18a91aaff0c614015d619863e2e749cd48db6f63ceeb4c49790ad78f4c07c6e7d9a8c42012cb06dd71f0339d4daae8f6
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.drop_force_if params['drop']
27
- task.exec params['table-def'] if params['table-def']
28
- task.exec params['sql-file']
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
- task.drop_force_if params['drop']
30
- task.exec params['table-def'] if params['table-def']
31
- task.truncate_if params['truncate']
32
- task.load params['src-ds'], params['src-file'], params['dest-table'],
33
- params['format'], params['jsonpath'], params['options']
34
- task.vacuum_if params['vacuum'], params['vacuum-sort']
35
- task.analyze_if params['analyze']
36
- task.grant_if params['grant'], params['dest-table']
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
  }
@@ -1,4 +1,4 @@
1
1
  module Bricolage
2
2
  APPLICATION_NAME = 'Bricolage'
3
- VERSION = '5.22.2'
3
+ VERSION = '5.22.3'
4
4
  end
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- bricolage (5.22.2)
4
+ bricolage (5.22.3)
5
5
  aws-sdk (~> 2)
6
6
  mysql2
7
7
  pg (~> 0.18.0)
@@ -69,4 +69,4 @@ DEPENDENCIES
69
69
  pry
70
70
 
71
71
  BUNDLED WITH
72
- 1.13.6
72
+ 1.14.3
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.2
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-01-18 00:00:00.000000000 Z
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.5.1
303
+ rubygems_version: 2.6.8
304
304
  signing_key:
305
305
  specification_version: 4
306
306
  summary: SQL Batch Framework