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 +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: 905cd291f9b03a51619ed92e3aa21a88775928df
|
4
|
+
data.tar.gz: 1d7616a5482652d634a4004c790825f3f638225a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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: 4.4.
|
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-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|