queuery_client 1.1.0 → 1.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 680cc3940c5e82d5ae0772d89cd25ffc00310236f9d92b6a686f900dd46f0a88
|
4
|
+
data.tar.gz: 468821770777a14d147958b69a3f21b8a88a827e677b787ec2eba6b06b6d1007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f42b47de00d2f718ce017a5e7a343b1e84a9f681ab3195796e81f7da3c85f5bf21b23cb5f5d4a151c2b0f3a8feba1e8fb01d2645fa17a9393803f3f6f6e0826e
|
7
|
+
data.tar.gz: 9139744e2b4f16ea8654e6e32e961270bb67b732eac50dd3633f227aa4d97b74249d3ff8ad91e9d47f2fbade3a47dcdda716b1f7a252ec58d90e7352d755cb0d
|
@@ -1,6 +1,17 @@
|
|
1
1
|
|
2
2
|
module QueueryClient
|
3
3
|
module RedshiftDataType
|
4
|
+
FALSE_VALUES = [
|
5
|
+
false, 0,
|
6
|
+
"0", :"0",
|
7
|
+
"f", :f,
|
8
|
+
"F", :F,
|
9
|
+
"false", :false,
|
10
|
+
"FALSE", :FALSE,
|
11
|
+
"off", :off,
|
12
|
+
"OFF", :OFF,
|
13
|
+
].to_set.freeze
|
14
|
+
|
4
15
|
def self.type_cast(row, manifest_file)
|
5
16
|
row.zip(manifest_file.column_types).map do |value, type|
|
6
17
|
next nil if (value == '' and type != 'character varing') # null becomes '' on unload
|
@@ -17,7 +28,7 @@ module QueueryClient
|
|
17
28
|
when 'date'
|
18
29
|
Date.parse(value)
|
19
30
|
when 'boolean'
|
20
|
-
value
|
31
|
+
FALSE_VALUES.include?(value) ? false : true
|
21
32
|
else
|
22
33
|
raise "not support data type: #{type}"
|
23
34
|
end
|
@@ -23,13 +23,19 @@ module QueueryClient
|
|
23
23
|
|
24
24
|
def data_files
|
25
25
|
b = Aws::S3::Resource.new(client: @s3_client).bucket(@bucket)
|
26
|
-
b.objects(prefix: @prefix)
|
26
|
+
b.objects(prefix: @prefix)
|
27
|
+
.select {|obj| obj.key.include?('_part_') }
|
28
|
+
.map {|obj| S3DataFile.new(obj) }
|
27
29
|
end
|
28
30
|
|
29
31
|
def manifest_file
|
30
32
|
b = Aws::S3::Resource.new(client: @s3_client).bucket(@bucket)
|
31
33
|
obj = b.object("#{@prefix}manifest")
|
32
|
-
|
34
|
+
if obj.exists?
|
35
|
+
S3ManifestFile.new(obj)
|
36
|
+
else
|
37
|
+
nil
|
38
|
+
end
|
33
39
|
end
|
34
40
|
|
35
41
|
def has_manifest?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queuery_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hidekazu Kobayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10
|
11
|
+
date: 2021-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: garage_client
|