avro-patches 0.4.1 → 1.0.0.pre0
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 +4 -4
- data/CHANGELOG.md +3 -2
- data/README.md +0 -1
- data/avro-patches.gemspec +1 -1
- data/lib/avro-patches.rb +1 -40
- data/lib/avro-patches/version.rb +1 -1
- metadata +7 -9
- data/lib/avro-patches/optimized_serde.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1818ee748fd5ee8c17e74d141bcfc9dc29c195762e3e05e10a475a609528c9c
|
4
|
+
data.tar.gz: 2d5ad54b308815f87dc0d2ac05d238926f14ecfd081f2dc5ef3aecf7cdefa4b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b07ce6b1231d84258d3e88d7342bd76ea0b28244de5805f9e75cad6ade35c4b46f6c445899bb180766bd66c59d3fa0cb27c8c79281b3d1176dc105fd5df4bfa6
|
7
|
+
data.tar.gz: 430350d55b3096351c7a6b00fd45682476d574585ce2184319496c7206ece97a2b5ade02d4422597b27700c6c84370f30fd7b978b1b1a0e804daaf840a5c2eb5
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# avro-patches
|
2
2
|
|
3
|
-
##
|
4
|
-
-
|
3
|
+
## v1.0.0
|
4
|
+
- Release for Avro v1.9.0. This removes all patches as all changes
|
5
|
+
from the previous release are included in Avro v1.9.0.
|
5
6
|
|
6
7
|
## v0.4.0
|
7
8
|
- Optionally fail validation when extra fields are present.
|
data/README.md
CHANGED
@@ -13,7 +13,6 @@ The following pending or unreleased changes are included:
|
|
13
13
|
- [AVRO-2039: Ruby encoding performance improvements](https://github.com/apache/avro/pull/230)
|
14
14
|
- [AVRO-2200: Option to fail when extra fields are in the payload](https://github.com/apache/avro/pull/321)
|
15
15
|
- [AVRO-2199: Validate that field defaults have the correct type](https://github.com/apache/avro/pull/320)
|
16
|
-
- [AVRO-2281: Optimize ruby binary encoder/decoder](https://github.com/apache/avro/pull/401)
|
17
16
|
|
18
17
|
In addition, compatibility with Ruby 2.4 (https://github.com/apache/avro/pull/191)
|
19
18
|
has been integrated with the changes above.
|
data/avro-patches.gemspec
CHANGED
data/lib/avro-patches.rb
CHANGED
@@ -1,42 +1,3 @@
|
|
1
1
|
require 'avro-patches/version'
|
2
2
|
|
3
|
-
|
4
|
-
# 'avro/ipc' calls methods that this gem patches.
|
5
|
-
#
|
6
|
-
# Replicate the require statements from avro.rb so that we can insert
|
7
|
-
# patches into the load order:
|
8
|
-
|
9
|
-
require 'multi_json'
|
10
|
-
require 'set'
|
11
|
-
require 'digest/md5'
|
12
|
-
require 'net/http'
|
13
|
-
require 'stringio'
|
14
|
-
require 'zlib'
|
15
|
-
|
16
|
-
module Avro
|
17
|
-
class AvroError < StandardError; end
|
18
|
-
|
19
|
-
class AvroTypeError < Avro::AvroError
|
20
|
-
def initialize(schm=nil, datum=nil, msg=nil)
|
21
|
-
msg ||= "Not a #{schm.to_s}: #{datum}"
|
22
|
-
super(msg)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
require 'avro/schema'
|
28
|
-
require 'avro/io'
|
29
|
-
require 'avro/schema_normalization'
|
30
|
-
|
31
|
-
# insert avro-patches
|
32
|
-
require 'avro-patches/ensure_encoding'
|
33
|
-
require 'avro-patches/schema_validator'
|
34
|
-
require 'avro-patches/logical_types'
|
35
|
-
require 'avro-patches/schema_compatibility'
|
36
|
-
require 'avro-patches/default_validation'
|
37
|
-
require 'avro-patches/optimized_serde'
|
38
|
-
|
39
|
-
# Remaining requires from the official avro gem
|
40
|
-
require 'avro/data_file'
|
41
|
-
require 'avro/protocol'
|
42
|
-
require 'avro/ipc'
|
3
|
+
require 'avro'
|
data/lib/avro-patches/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avro-patches
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0.pre0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salsify, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.9.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.9.0
|
83
83
|
description: Patches for the official Apache Avro Ruby implementation
|
84
84
|
email:
|
85
85
|
- engineering@salsify.com
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- lib/avro-patches/logical_types/logical_types.rb
|
110
110
|
- lib/avro-patches/logical_types/schema.rb
|
111
111
|
- lib/avro-patches/logical_types/schema_validator.rb
|
112
|
-
- lib/avro-patches/optimized_serde.rb
|
113
112
|
- lib/avro-patches/schema_compatibility.rb
|
114
113
|
- lib/avro-patches/schema_compatibility/io.rb
|
115
114
|
- lib/avro-patches/schema_compatibility/schema.rb
|
@@ -136,12 +135,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
135
|
version: '0'
|
137
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
137
|
requirements:
|
139
|
-
- - "
|
138
|
+
- - ">"
|
140
139
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
140
|
+
version: 1.3.1
|
142
141
|
requirements: []
|
143
|
-
|
144
|
-
rubygems_version: 2.7.7
|
142
|
+
rubygems_version: 3.0.3
|
145
143
|
signing_key:
|
146
144
|
specification_version: 4
|
147
145
|
summary: Patches for the official Apache Avro Ruby implementation
|
@@ -1,53 +0,0 @@
|
|
1
|
-
Avro::IO::BinaryDecoder.class_eval do
|
2
|
-
|
3
|
-
def byte!
|
4
|
-
@reader.readbyte
|
5
|
-
end
|
6
|
-
|
7
|
-
def read_float
|
8
|
-
read_and_unpack(4, 'e'.freeze)
|
9
|
-
end
|
10
|
-
|
11
|
-
def read_double
|
12
|
-
read_and_unpack(8, 'E'.freeze)
|
13
|
-
end
|
14
|
-
|
15
|
-
def read_string
|
16
|
-
read_bytes.tap do |string|
|
17
|
-
string.force_encoding('utf-8'.freeze) if string.respond_to?(:force_encoding)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
# Optimize unpacking strings when `unpack1` is available (ruby >= 2.4)
|
24
|
-
if String.instance_methods.include?(:unpack1)
|
25
|
-
|
26
|
-
def read_and_unpack(byte_count, format)
|
27
|
-
@reader.read(byte_count).unpack1(format)
|
28
|
-
end
|
29
|
-
|
30
|
-
else
|
31
|
-
|
32
|
-
def read_and_unpack(byte_count, format)
|
33
|
-
@reader.read(byte_count).unpack(format)[0]
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
Avro::IO::BinaryEncoder.class_eval do
|
40
|
-
|
41
|
-
def write_float(datum)
|
42
|
-
@writer.write([datum].pack('e'.freeze))
|
43
|
-
end
|
44
|
-
|
45
|
-
def write_double(datum)
|
46
|
-
@writer.write([datum].pack('E'.freeze))
|
47
|
-
end
|
48
|
-
|
49
|
-
def write_string(datum)
|
50
|
-
datum = datum.encode('utf-8'.freeze) if datum.respond_to?(:encode)
|
51
|
-
write_bytes(datum)
|
52
|
-
end
|
53
|
-
end
|