pigspec 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e976beef7562e44da2622c367d5aed0c9b8fd0b
4
- data.tar.gz: fdd80f3420090ac64a1b9389c67992db7b745f26
3
+ metadata.gz: a3fb02b1553f14d7aabd0b1d2ca952ab42c849af
4
+ data.tar.gz: a856137bce4e3292c4435466a57870e34be8b2f2
5
5
  SHA512:
6
- metadata.gz: 5b3bb24cb0bd3379653a4c90a8969777043d0a007cef7eee33e4ebe5bc6497432abe5c1ad981b6b7476dc57bb3ea3f28bb2be36a7b2126b79fab8dde83e2004d
7
- data.tar.gz: d65677aa13302ea25c6d54acedbf43117188f939baf8062b3918dedbf652699b6d13a55428db30957191e4efdc7d331fe15c34d9022691e04823279a6f84f5fd
6
+ metadata.gz: 3a84c9d6b724695026d76c2c90006650b37ea69240a6a381c27df26a2876e8a858a041dd0f02090a7a412ac58b8f1e47c5495c8907c6ced02f9e6c546310b16b
7
+ data.tar.gz: f6484d7efe2433ff1e064733cbd60c4ede92d558d4a6ac3c0fca4723d92e4f42b28b9efbed54a408d3c902041bebdd3a5077abe5ce04bc77865a514cf115252d
@@ -124,6 +124,7 @@ module PigSpec
124
124
  when types.DOUBLE, types.FLOAT then value.toString.to_f
125
125
  when types.BOOLEAN then value.toString.downcase.include? 't'
126
126
  when types.TUPLE then read_tuple value
127
+ when types.BAG then read_bag value
127
128
  # TODO: types.MAP is schemaless...How to cast it...?
128
129
  when types.MAP then value.toString # read_map value
129
130
  when types.UNKNOWN then nil
@@ -131,6 +132,14 @@ module PigSpec
131
132
  end
132
133
  end
133
134
 
135
+ def read_bag(bag)
136
+ casted = []
137
+ bag.each do |tuple|
138
+ casted.push read_tuple(tuple)
139
+ end
140
+ casted
141
+ end
142
+
134
143
  def read_tuple(tuple)
135
144
  casted = []
136
145
  tuple.size.times do|index|
@@ -1,4 +1,4 @@
1
1
  # PigSpec version constant
2
2
  module PigSpec
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pigspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - shiracha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-30 00:00:00.000000000 Z
11
+ date: 2014-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rjb