redshift-connector 5.4.0 → 5.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/redshift-connector/exporter.rb +2 -1
- data/lib/redshift-connector/query.rb +5 -3
- data/lib/redshift-connector/version.rb +1 -1
- data/test/foreach.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c334f32bf3c597fc80cdf2e783f6eea993e58166
|
4
|
+
data.tar.gz: ec1e1f4b3bb6d5ae2561c5c401ac4bf6644fc4f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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.
|
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-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|