avro 1.9.0 → 1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +2 -2
- data/Manifest +1 -0
- data/NOTICE +1 -1
- data/Rakefile +12 -15
- data/avro.gemspec +11 -11
- data/interop/test_interop.rb +13 -3
- data/lib/avro.rb +15 -3
- data/lib/avro/VERSION.txt +1 -0
- data/lib/avro/data_file.rb +25 -2
- data/lib/avro/io.rb +34 -27
- data/lib/avro/ipc.rb +3 -3
- data/lib/avro/logical_types.rb +1 -1
- data/lib/avro/protocol.rb +1 -1
- data/lib/avro/schema.rb +174 -29
- data/lib/avro/schema_compatibility.rb +25 -14
- data/lib/avro/schema_normalization.rb +1 -1
- data/lib/avro/schema_validator.rb +36 -31
- data/test/case_finder.rb +9 -4
- data/test/random_data.rb +4 -3
- data/test/sample_ipc_client.rb +1 -1
- data/test/sample_ipc_http_client.rb +1 -1
- data/test/sample_ipc_http_server.rb +1 -1
- data/test/sample_ipc_server.rb +1 -1
- data/test/test_datafile.rb +14 -1
- data/test/test_fingerprints.rb +20 -1
- data/test/test_help.rb +1 -1
- data/test/test_io.rb +83 -2
- data/test/test_logical_types.rb +1 -1
- data/test/test_protocol.rb +1 -1
- data/test/test_schema.rb +269 -1
- data/test/test_schema_compatibility.rb +71 -1
- data/test/test_schema_normalization.rb +2 -1
- data/test/test_schema_validator.rb +10 -4
- data/test/test_socket_transport.rb +1 -1
- data/test/tool.rb +4 -4
- metadata +17 -15
@@ -7,7 +7,7 @@
|
|
7
7
|
# "License"); you may not use this file except in compliance
|
8
8
|
# with the License. You may obtain a copy of the License at
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
11
11
|
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -166,6 +166,7 @@ class TestSchemaNormalization < Test::Unit::TestCase
|
|
166
166
|
CaseFinder.cases.each do |test_case|
|
167
167
|
schema = Avro::Schema.parse(test_case.input)
|
168
168
|
assert_equal test_case.canonical, Avro::SchemaNormalization.to_parsing_form(schema)
|
169
|
+
assert_equal test_case.fingerprint, schema.crc_64_avro_fingerprint
|
169
170
|
end
|
170
171
|
end
|
171
172
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# "License"); you may not use this file except in compliance
|
7
7
|
# with the License. You may obtain a copy of the License at
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
10
|
#
|
11
11
|
# Unless required by applicable law or agreed to in writing, software
|
12
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -16,8 +16,8 @@
|
|
16
16
|
|
17
17
|
require 'test_help'
|
18
18
|
|
19
|
-
class
|
20
|
-
def validate!(schema, value, options=
|
19
|
+
class TestSchemaValidator < Test::Unit::TestCase
|
20
|
+
def validate!(schema, value, options = {})
|
21
21
|
Avro::SchemaValidator.validate!(schema, value, options)
|
22
22
|
end
|
23
23
|
|
@@ -196,6 +196,12 @@ class TestSchema < Test::Unit::TestCase
|
|
196
196
|
assert_valid_schema(schema, [{ 'sub' => nil }], [{ 'sub' => 1 }])
|
197
197
|
end
|
198
198
|
|
199
|
+
def test_validate_record_with_symbol_keys
|
200
|
+
schema = hash_to_schema(type: 'record', name: 'name', fields: [{ type: 'int', name: 'sub' }])
|
201
|
+
|
202
|
+
assert_valid_schema(schema, [{ sub: 1 }], [{ sub: '1' }])
|
203
|
+
end
|
204
|
+
|
199
205
|
def test_validate_shallow_record
|
200
206
|
schema = hash_to_schema(
|
201
207
|
type: 'record', name: 'name', fields: [{ type: 'int', name: 'sub' }]
|
@@ -277,7 +283,7 @@ class TestSchema < Test::Unit::TestCase
|
|
277
283
|
|
278
284
|
def test_validate_union_of_nil_and_record_inside_array
|
279
285
|
schema = hash_to_schema(
|
280
|
-
name: '
|
286
|
+
name: 'this_does_not_matter',
|
281
287
|
type: 'record',
|
282
288
|
fields: [
|
283
289
|
{
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# "License"); you may not use this file except in compliance
|
7
7
|
# with the License. You may obtain a copy of the License at
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
10
|
#
|
11
11
|
# Unless required by applicable law or agreed to in writing, software
|
12
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
data/test/tool.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# "License"); you may not use this file except in compliance
|
7
7
|
# with the License. You may obtain a copy of the License at
|
8
8
|
#
|
9
|
-
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
10
|
#
|
11
11
|
# Unless required by applicable law or agreed to in writing, software
|
12
12
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -27,7 +27,7 @@ class GenericResponder < Avro::IPC::Responder
|
|
27
27
|
@datum = datum
|
28
28
|
end
|
29
29
|
|
30
|
-
def call(message,
|
30
|
+
def call(message, _request)
|
31
31
|
if message.name == @msg
|
32
32
|
STDERR.puts "Message: #{message.name} Datum: #{@datum.inspect}"
|
33
33
|
@datum
|
@@ -101,7 +101,7 @@ def main
|
|
101
101
|
case ARGV[4]
|
102
102
|
when "-file"
|
103
103
|
Avro::DataFile.open(ARGV[5]) {|f|
|
104
|
-
f.each{|
|
104
|
+
f.each{|e| datum = e; break }
|
105
105
|
}
|
106
106
|
when "-data"
|
107
107
|
puts "JSON Decoder not yet implemented."
|
@@ -124,7 +124,7 @@ def main
|
|
124
124
|
if ARGV.size > 4
|
125
125
|
case ARGV[4]
|
126
126
|
when "-file"
|
127
|
-
Avro::DataFile.open(ARGV[5]){|f| f.each{|
|
127
|
+
Avro::DataFile.open(ARGV[5]){|f| f.each{|e| datum = e; break } }
|
128
128
|
when "-data"
|
129
129
|
puts "JSON Decoder not yet implemented"
|
130
130
|
return 1
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apache Software Foundation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1'
|
27
27
|
description: Avro is a data serialization and RPC format
|
28
28
|
email: dev@avro.apache.org
|
29
29
|
executables: []
|
@@ -32,6 +32,7 @@ extra_rdoc_files:
|
|
32
32
|
- CHANGELOG
|
33
33
|
- LICENSE
|
34
34
|
- lib/avro.rb
|
35
|
+
- lib/avro/VERSION.txt
|
35
36
|
- lib/avro/data_file.rb
|
36
37
|
- lib/avro/io.rb
|
37
38
|
- lib/avro/ipc.rb
|
@@ -50,6 +51,7 @@ files:
|
|
50
51
|
- avro.gemspec
|
51
52
|
- interop/test_interop.rb
|
52
53
|
- lib/avro.rb
|
54
|
+
- lib/avro/VERSION.txt
|
53
55
|
- lib/avro/data_file.rb
|
54
56
|
- lib/avro/io.rb
|
55
57
|
- lib/avro/ipc.rb
|
@@ -77,9 +79,9 @@ files:
|
|
77
79
|
- test/test_schema_validator.rb
|
78
80
|
- test/test_socket_transport.rb
|
79
81
|
- test/tool.rb
|
80
|
-
homepage:
|
82
|
+
homepage: https://avro.apache.org/
|
81
83
|
licenses:
|
82
|
-
- Apache
|
84
|
+
- Apache-2.0
|
83
85
|
metadata: {}
|
84
86
|
post_install_message:
|
85
87
|
rdoc_options:
|
@@ -105,14 +107,14 @@ signing_key:
|
|
105
107
|
specification_version: 4
|
106
108
|
summary: Apache Avro for Ruby
|
107
109
|
test_files:
|
108
|
-
- test/test_schema_validator.rb
|
109
|
-
- test/test_help.rb
|
110
|
-
- test/test_schema_normalization.rb
|
111
|
-
- test/test_datafile.rb
|
112
110
|
- test/test_schema.rb
|
113
|
-
- test/test_io.rb
|
114
111
|
- test/test_socket_transport.rb
|
115
|
-
- test/
|
112
|
+
- test/test_io.rb
|
116
113
|
- test/test_logical_types.rb
|
117
|
-
- test/
|
114
|
+
- test/test_help.rb
|
115
|
+
- test/test_datafile.rb
|
118
116
|
- test/test_protocol.rb
|
117
|
+
- test/test_schema_validator.rb
|
118
|
+
- test/test_schema_compatibility.rb
|
119
|
+
- test/test_schema_normalization.rb
|
120
|
+
- test/test_fingerprints.rb
|