redshift-connector 5.4.0 → 5.4.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: 58ae198b8bba6ce5c279bd67b1e5e9de6d05c007
4
- data.tar.gz: d403857e6f2439ee654e18537d93bb67a333ab04
3
+ metadata.gz: c334f32bf3c597fc80cdf2e783f6eea993e58166
4
+ data.tar.gz: ec1e1f4b3bb6d5ae2561c5c401ac4bf6644fc4f6
5
5
  SHA512:
6
- metadata.gz: 6cb22409f2c133ca2974f4279106615628edd4d12512e7e069a7d140f4d056e7e6470a57a95b85db0065bf763753d6ff3c705d17c7ae475414126d4318389dc2
7
- data.tar.gz: '049a4bec56136974dfeadcba78564337927b5420acd03d1fd098ff1314ea80ca217764a9ff6b2f53b01eaf8aa8f91b615ac6883f410d3ce2a7919b91a5d257ab'
6
+ metadata.gz: c7693bbacee2b71405da3d48d244775c0cf39f7225d9d2f1d67fc2e48ff5132b9cadd7ccf5c523076ed5404928a2d40e8e13debf159be7213b89c8df7015cda2
7
+ data.tar.gz: df952ee8ef13d61c7efd1dfd9643e4018a6978cb9cfe6d3e1a36bd845ccbafa59b6bfa726e80978a1d62114bbf001287b3a9e249cb242902c6c823859549a730
@@ -41,6 +41,7 @@ module RedshiftConnector
41
41
  query:,
42
42
  txn_id: "#{Time.now.strftime('%Y%m%d_%H%M%S')}_#{$$}",
43
43
  filter: nil,
44
+ enable_sort: false,
44
45
  logger: RedshiftConnector.logger,
45
46
  quiet: false
46
47
  )
@@ -56,7 +57,7 @@ module RedshiftConnector
56
57
  )
57
58
  exporter = Exporter.new(
58
59
  ds: ds,
59
- query: UnloadQuery.wrap(query: query, bundle: bundle),
60
+ query: UnloadQuery.wrap(query: query, bundle: bundle, enable_sort: enable_sort),
60
61
  bundle: bundle,
61
62
  logger: logger
62
63
  )
@@ -44,13 +44,14 @@ module RedshiftConnector
44
44
  end
45
45
 
46
46
  class UnloadQuery
47
- def UnloadQuery.wrap(query:, bundle:)
48
- new(query: ArbitraryQuery.new(query), bundle: bundle)
47
+ def UnloadQuery.wrap(query:, bundle:, enable_sort: false)
48
+ new(query: ArbitraryQuery.new(query), bundle: bundle, enable_sort: enable_sort)
49
49
  end
50
50
 
51
- def initialize(query:, bundle:)
51
+ def initialize(query:, bundle:, enable_sort: false)
52
52
  @query = query
53
53
  @bundle = bundle
54
+ @enable_sort = enable_sort
54
55
  end
55
56
 
56
57
  def table_spec
@@ -68,6 +69,7 @@ module RedshiftConnector
68
69
  credentials '#{@bundle.credential_string}'
69
70
  gzip
70
71
  allowoverwrite
72
+ parallel #{@enable_sort ? 'off' : 'on'}
71
73
  delimiter ',' escape addquotes
72
74
  EndSQL
73
75
  end
@@ -1,3 +1,3 @@
1
1
  module RedshiftConnector
2
- VERSION = '5.4.0'
2
+ VERSION = '5.4.1'
3
3
  end
data/test/foreach.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require_relative 'helper'
2
2
 
3
- RedshiftConnector.foreach(schema: 'tabemiru', table: 'items', query: 'select * from tabemiru.items where id < 10') do |row|
3
+ RedshiftConnector.foreach(schema: 'tabemiru', table: 'items', query: 'select id from tabemiru.items where id < 50 order by 1', enable_sort: true) do |row|
4
4
  p row
5
5
  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: 5.4.0
4
+ version: 5.4.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-03-22 00:00:00.000000000 Z
11
+ date: 2017-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord