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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bae31969c118f27e2a1e3796a72dff3c7c63db4ce7b12db6f967d8f5b222ee5
4
- data.tar.gz: 13bcbc2a1eaee55ba0b27d6aa2848147829c90d85a7089d35fb22e01ae586053
3
+ metadata.gz: ee67e88dd319c32dabd83b2ee9c0b701a9f02e5f6362fada4d017232011d8dd7
4
+ data.tar.gz: 5a06d816db267a0ef903a607bff35b33a747a268cb04a9c2187e766abeb49182
5
5
  SHA512:
6
- metadata.gz: 04d7dc514fb2c0869a1b8ef071117b22da51ce162a31169b76a413c9bfb356b12ff7493e3fdbce5b8691033ad013254c53547d592f12f17bc554600e1ecc4d0d
7
- data.tar.gz: fafaca859454f78f81b63961360c4baad6b0ec2614c0a8b675cb14a9df5c6aaef3bf4b72050effce84418415271567bf4a3032bef27abcb4bcbcd8e22ab160b2
6
+ metadata.gz: 399868f168698110c4725a993e066e78fd8730942519af34b8e785a41bbfa51f10e65078c44f3ea7264e41aa84e7de5a48b6652e95467d7e8fabf481595e0cff
7
+ data.tar.gz: d393e87fc5dec19f2528910a6ed2e2e3714aeb6886124d56acaaaac38102e7e61dde42a1721f1d8c98e852e55a5f73481e5a016cbc191474cf97a188268dc001
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parqueteur (1.3.2)
4
+ parqueteur (1.3.3)
5
5
  red-parquet (~> 6.0)
6
6
 
7
7
  GEM
@@ -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 = 100.times.collect do |i|
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' => { 'a' => 'b' },
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',
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Parqueteur
4
4
  class Converter
5
- DEFAULT_BATCH_SIZE = 10
5
+ DEFAULT_BATCH_SIZE = 100
6
6
 
7
7
  def self.inline(&block)
8
8
  Class.new(self, &block)
@@ -4,18 +4,7 @@ module Parqueteur
4
4
  module Types
5
5
  class MapType < Parqueteur::Type
6
6
  def build_value_array(values)
7
- builder = Arrow::MapArrayBuilder.new(arrow_type)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parqueteur
4
- VERSION = '1.3.2'
4
+ VERSION = '1.3.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parqueteur
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien D.