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: 2a5b41cb805e7fc0864fd695adc519c6b7212c294383935af40301d88b5b8d63
4
- data.tar.gz: d4e970371d23e36bf40d4cafdf9e7da0d886c25bb0882ce9e12fc2a971a0e2c0
3
+ metadata.gz: 680cc3940c5e82d5ae0772d89cd25ffc00310236f9d92b6a686f900dd46f0a88
4
+ data.tar.gz: 468821770777a14d147958b69a3f21b8a88a827e677b787ec2eba6b06b6d1007
5
5
  SHA512:
6
- metadata.gz: f61f86445e64fca2863ba474a6cfb27e87af761516b3fbb5394adbe6f61e23e4f9d81778cded02dc512bf495bb8b711099962b5fd63154880bcc3e746bf25f61
7
- data.tar.gz: ee0f09b1e92729056857117a7fdf4fa422d13bae5168f521e6d2cd8ca8adc2152334c59fd826aff916369ee8db811c792a49087ddd08dfdb283c0a31445bab78
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 == 'true' ? true : false
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).map {|obj| S3DataFile.new(obj) }
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
- S3ManifestFile.new(obj)
34
+ if obj.exists?
35
+ S3ManifestFile.new(obj)
36
+ else
37
+ nil
38
+ end
33
39
  end
34
40
 
35
41
  def has_manifest?
@@ -1,3 +1,3 @@
1
1
  module QueueryClient
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.2"
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2021-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: garage_client