redshift-connector 7.2.1 → 7.2.2

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
  SHA256:
3
- metadata.gz: 6d05034adedce4cea33f24328428eb4823e89224eba62cd3548bf41e329cfe5d
4
- data.tar.gz: 85b98e33059fcac9e50e505f9eea6cfc53665cf31b66a1de1fc676199150687d
3
+ metadata.gz: 4f47b165de991c70d180287a0344aa4df32ebd4598a4d63a7051ad05de830411
4
+ data.tar.gz: fb49ab5b32dc294ef5ed4765e86245f785928baf9a2e4f1987893e9389c6b2a6
5
5
  SHA512:
6
- metadata.gz: 6ab6e0528d17951481902ed37679f110bed1718848a17cb962598524e5439e3784dc46b9293222fdf93e0c74ab820d58243e92fc3268172e91019140e99d92dc
7
- data.tar.gz: 9800067fa5f06ea4268702519650b1155cdb71c212852402e7cf539f9e25a9408a2987f2e77b97ac6551dd8f5d7511e12fca10d9ebabfcaf07653f5f1feac464
6
+ metadata.gz: 0fcb7883e334fad7711ebe427455ec4c0f469fb92ef91501eff75ed8619030c50cce600a03b6fba10b234c0b1b64b9c29ade461728b9e74f6ebaffbf51a02dd4
7
+ data.tar.gz: 8f31695f5765d305d728bc6a5fec556cb7f1a908e537defd61e6acd891483fbb4da10eef92373bbd260a8a8a26a362b667f65270407e4b4f73193417056e4a94
data/RELEASE.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release Note
2
2
 
3
+ ## version 7.2.2
4
+
5
+ - [fix] RedshiftConnector.transport_all: src_table/dest_table parameter did not work.
6
+ - [fix] RedshiftConnector.transport_all (strategy=rename): newer activerecord-import requires class name.
7
+
3
8
  ## version 7.2.1
4
9
 
5
10
  - no change.
@@ -115,7 +115,7 @@ module RedshiftConnector
115
115
  def Connector.transport_all(
116
116
  strategy: 'rename',
117
117
  schema:,
118
- table:,
118
+ table: nil,
119
119
  src_table: table,
120
120
  dest_table: table,
121
121
  columns:,
@@ -1,5 +1,6 @@
1
1
  require 'redshift_connector/importer/activerecord-import'
2
2
  require 'redshift_connector/logger'
3
+ require 'thread'
3
4
 
4
5
  module RedshiftConnector
5
6
  class Importer::RebuildRename
@@ -14,7 +15,7 @@ module RedshiftConnector
14
15
  tmp_table = "#{dest_table}_new"
15
16
  old_table = "#{dest_table}_old"
16
17
 
17
- tmp_dao = @dao.dup
18
+ tmp_dao = self.class.make_temporary_dao(@dao)
18
19
  tmp_dao.table_name = tmp_table
19
20
 
20
21
  exec_update "drop table if exists #{tmp_table}"
@@ -25,6 +26,23 @@ module RedshiftConnector
25
26
  exec_update "rename table #{dest_table} to #{old_table}, #{tmp_table} to #{dest_table}"
26
27
  end
27
28
 
29
+ # Duplicates DAO (ActiveRecord class) and names it.
30
+ # Newer activerecord-import requires a class name (not a table name),
31
+ # we must prepare some name for temporary DAO class.
32
+ def self.make_temporary_dao(orig)
33
+ tmp = orig.dup
34
+ const_set("TemporaryDAO_#{get_unique_sequence}", tmp)
35
+ tmp.name # fix class name
36
+ tmp
37
+ end
38
+
39
+ @dao_seq = 0
40
+ @dao_seq_lock = Mutex.new
41
+
42
+ def self.get_unique_sequence
43
+ @dao_seq_lock.synchronize { @dao_seq += 1 }
44
+ end
45
+
28
46
  def exec_update(query)
29
47
  @logger.info query
30
48
  @dao.connection.execute(query)
@@ -1,3 +1,3 @@
1
1
  module RedshiftConnector
2
- VERSION = '7.2.1'
2
+ VERSION = '7.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redshift-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.1
4
+ version: 7.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-25 00:00:00.000000000 Z
11
+ date: 2019-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redshift-connector-data_file
@@ -158,8 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.7.6
161
+ rubygems_version: 3.0.3
163
162
  signing_key:
164
163
  specification_version: 4
165
164
  summary: Redshift bulk data connector