parqueteur 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/examples/hello-world.rb +5 -2
- data/lib/parqueteur/converter.rb +1 -1
- data/lib/parqueteur/types/map_type.rb +1 -12
- data/lib/parqueteur/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee67e88dd319c32dabd83b2ee9c0b701a9f02e5f6362fada4d017232011d8dd7
|
4
|
+
data.tar.gz: 5a06d816db267a0ef903a607bff35b33a747a268cb04a9c2187e766abeb49182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 399868f168698110c4725a993e066e78fd8730942519af34b8e785a41bbfa51f10e65078c44f3ea7264e41aa84e7de5a48b6652e95467d7e8fabf481595e0cff
|
7
|
+
data.tar.gz: d393e87fc5dec19f2528910a6ed2e2e3714aeb6886124d56acaaaac38102e7e61dde42a1721f1d8c98e852e55a5f73481e5a016cbc191474cf97a188268dc001
|
data/Gemfile.lock
CHANGED
data/examples/hello-world.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'securerandom'
|
1
2
|
require 'bundler/setup'
|
2
3
|
require 'parqueteur'
|
3
4
|
|
@@ -17,14 +18,16 @@ class FooParquetConverter < Parqueteur::Converter
|
|
17
18
|
column :my_timestamp, :timestamp
|
18
19
|
end
|
19
20
|
|
20
|
-
data =
|
21
|
+
data = 1000.times.collect do |i|
|
21
22
|
{
|
22
23
|
'id' => i,
|
23
24
|
'my_string_array' => %w[a b c],
|
24
25
|
'my_date' => Date.today,
|
25
26
|
'my_decimal' => BigDecimal('0.03'),
|
26
27
|
'my_int' => rand(1..10),
|
27
|
-
'my_map' => {
|
28
|
+
'my_map' => 20.times.each_with_object({}) do |idx, hash|
|
29
|
+
hash["k_#{idx}"] = SecureRandom.urlsafe_base64(64)
|
30
|
+
end,
|
28
31
|
'my_string' => 'Hello World',
|
29
32
|
'my_struct' => {
|
30
33
|
'my_struct_str' => 'Hello World',
|
data/lib/parqueteur/converter.rb
CHANGED
@@ -4,18 +4,7 @@ module Parqueteur
|
|
4
4
|
module Types
|
5
5
|
class MapType < Parqueteur::Type
|
6
6
|
def build_value_array(values)
|
7
|
-
|
8
|
-
values.each do |entry|
|
9
|
-
builder.append_value
|
10
|
-
next if entry.nil?
|
11
|
-
|
12
|
-
entry.each do |k, v|
|
13
|
-
builder.key_builder.append(k)
|
14
|
-
builder.item_builder.append(v)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
builder.finish
|
7
|
+
Arrow::MapArrayBuilder.build(arrow_type, values)
|
19
8
|
end
|
20
9
|
|
21
10
|
def arrow_type_builder
|
data/lib/parqueteur/version.rb
CHANGED