dataMetaAvro 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +4 -0
- data/README.md +10 -2
- data/bin/dataMetaAvroSchemaGen.rb +1 -1
- data/lib/dataMetaAvro.rb +1 -1
- data/test/test_dataMetaAvro.rb +1 -1
- metadata +24 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f2405ef0557513c075fc8a9147b4dda985e8880
|
4
|
+
data.tar.gz: 1f35340422a09ed53e86415bd274d4fea4dbdbf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a036562c516e1e108aff72d5917d70b881051e50937c49cf1ed6b1350d497840dc4da673eafca3c3668aa290c0811d03cfe620357ca59ec8d6373878547cb80
|
7
|
+
data.tar.gz: 5d9b9a46c5b40783eceb3751e4ee399d18a1f86729a2a9f920848e0a4b983ef32f51b4791fa7433ce59e4b3e7e56080729f6f0f2dd72b05e6ac1ee7b4ea74b7c
|
data/History.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# DataMetaAvro
|
2
2
|
|
3
|
-
DataMeta [Avro](http://avro.apache.org/docs/
|
4
|
-
[Avro Schema](http://avro.apache.org/docs/
|
3
|
+
DataMeta [Avro](http://avro.apache.org/docs/current) utilities, such as DataMetaDOM source to
|
4
|
+
[Avro Schema](http://avro.apache.org/docs/current/spec.html) converter.
|
5
5
|
|
6
6
|
References to this gem's:
|
7
7
|
|
@@ -25,6 +25,14 @@ cause an error during export.
|
|
25
25
|
|
26
26
|
### Avro schema generator
|
27
27
|
|
28
|
+
Since DataMeta DOM is superset of Avro data types, tradeoffs are made:
|
29
|
+
|
30
|
+
* The DataMeta `datetime` is converted to an integral type as described in the [Avro Schema Docs](http://avro.apache.org/docs/current/spec.html#Time+%28millisecond+precision%29)
|
31
|
+
* The DataMeta aggregate types `set`, `deque`, `list` all converted to [Avro arrays](http://avro.apache.org/docs/current/spec.html#Arrays).
|
32
|
+
* Since Avro allows strings only as map keys, an attempt to convert a DataMeta DOM with a mapping with keys other than
|
33
|
+
`string` will cause an error.
|
34
|
+
* The DataMeta type `numeric` will cause an error during conversion.
|
35
|
+
|
28
36
|
* Runnables:
|
29
37
|
* <tt>dataMetaAvroSchemaGen.rb</tt> - generate [Avro](http://avro.apache.org/docs/current) [Schemas](http://avro.apache.org/docs/current/spec.html),
|
30
38
|
one file per class
|
@@ -14,7 +14,7 @@ puts "Generating #{@source} into #{@target}"
|
|
14
14
|
|
15
15
|
@parser = DataMetaDom::Model.new
|
16
16
|
begin
|
17
|
-
@parser.parse(@source)
|
17
|
+
@parser.parse(@source, options={autoVerNs: true})
|
18
18
|
DataMetaAvro::genSchema(@parser, @target)
|
19
19
|
rescue Exception => e
|
20
20
|
puts "ERROR #{e.message}; #{@parser.diagn}"
|
data/lib/dataMetaAvro.rb
CHANGED
data/test/test_dataMetaAvro.rb
CHANGED
@@ -19,7 +19,7 @@ class TestNewGem < Test::Unit::TestCase
|
|
19
19
|
# Smell-check the parsing
|
20
20
|
def test_parsing
|
21
21
|
model = DataMetaDom::Model.new
|
22
|
-
model.parse(File.join(File.dirname(__FILE__), 'sample.dmDom'), options={
|
22
|
+
model.parse(File.join(File.dirname(__FILE__), 'sample.dmDom'), options={autoVerNs: true})
|
23
23
|
L.info(%<Model: #{model}>)
|
24
24
|
FileUtils.rmtree(GEN_TARGET) if File.exist?(GEN_TARGET)
|
25
25
|
FileUtils.mkpath GEN_TARGET
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dataMetaAvro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bergens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dataMetaDom
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '1.0'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.
|
22
|
+
version: 1.0.6
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,27 @@ dependencies:
|
|
29
29
|
version: '1.0'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.
|
32
|
+
version: 1.0.6
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: avro
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.8'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.8.1
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.8'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.8.1
|
33
53
|
description: DataMeta DOM to Avro schema generator
|
34
54
|
email: michael.bergens@gmail.com
|
35
55
|
executables:
|