redshift-connector 4.4.0 → 4.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: 5fad88bacc8b957a0998671cf67e42f78875885a
4
- data.tar.gz: 6400dca6b09e108a07e55dee70ace8837f0c835b
3
+ metadata.gz: 905cd291f9b03a51619ed92e3aa21a88775928df
4
+ data.tar.gz: 1d7616a5482652d634a4004c790825f3f638225a
5
5
  SHA512:
6
- metadata.gz: d497cb031811c9f8b97ddfc021ab87dd77fceae0b27de3bb3e3453bb4c0e79cdb478f467ccf0a7b1edfa02aa3a010bcead744f55b5dfa28d98c9b24f4c96ea96
7
- data.tar.gz: 48287e7d2aca4294d4b940388f4545bb9b3dc010b1ff4a014acfe01b8d220208b53a54e25a0d5e311b769d7254d985fe6f07fa02ae9f06f3a50776ddeb97828a
6
+ metadata.gz: d70d4f5ea5a0ba4369b1d9f730b0a861779c3f66b72eb036ca34653817af3c2d32e6d42190f4f61438a9324851a77eba2f2651e3b6472520aff5f13b2f500edf
7
+ data.tar.gz: 6d2683f7361f3706a916d6bab4571a5bfa0a6ca8baeff3155c25005174ea1d07468c0b8959765be7548540a2a3c74e316e358e841ba0ff4c42f3e8df373c5a0e
@@ -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 = '4.4.0'
2
+ VERSION = '4.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: 4.4.0
4
+ version: 4.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