forked from datacontract/datacontract-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature import avro with logical type default values (datacontrac…
…t#217) * avro importer with support for logicalTypes and default * add support for exporting to avro with logicalType and default values from a datacontract that supports the new config for avro * encapsulate handle avro config properties * documentation for avro custom fields * changelog mention
- Loading branch information
1 parent
702ba50
commit d59518e
Showing
9 changed files
with
206 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"type": "record", | ||
"name": "Test", | ||
"namespace": "mynamespace.com", | ||
"fields": [ | ||
{"name": "test_id", "type": "string", "doc": "id documentation test"}, | ||
{"name": "device_id", "type": "int"}, | ||
{"name": "test_value", "type": "double"}, | ||
{"name": "num_items", "type": "int"}, | ||
{"name": "processed_timestamp", | ||
"type": "long", | ||
"doc": "The date the event was processed: for more info https://avro.apache.org/docs/current/spec.html#Local+timestamp+%28microsecond+precision%29", | ||
"logicalType": "local-timestamp-micros"}, | ||
{"name": "description", "type": "string"}, | ||
{"name": "is_processed", "type": "boolean", | ||
"default": false} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"type": "record", | ||
"name": "Test", | ||
"namespace": "mynamespace.com", | ||
"fields": [ | ||
{"name": "test_id", "type": "string", "doc": "id documentation test"}, | ||
{"name": "device_id", "type": "int"}, | ||
{"name": "test_value", "type": "double"}, | ||
{"name": "num_items", "type": "int"}, | ||
{"name": "processed_timestamp", | ||
"type": "long", | ||
"doc": "The date the event was processed: for more info https://avro.apache.org/docs/current/spec.html#Local+timestamp+%28microsecond+precision%29", | ||
"logicalType": "local-timestamp-micros"}, | ||
{"name": "description", "type": "string"}, | ||
{"name": "is_processed", "type": "boolean", | ||
"default": false} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
dataContractSpecification: 0.9.3 | ||
id: my-data-contract-id | ||
info: | ||
title: My Data Contract | ||
version: 0.0.1 | ||
models: | ||
Test: | ||
namespace: mynamespace.com | ||
fields: | ||
test_id: | ||
type: string | ||
required: true | ||
description: id documentation test | ||
device_id: | ||
type: int | ||
required: true | ||
test_value: | ||
type: double | ||
required: true | ||
num_items: | ||
type: int | ||
required: true | ||
processed_timestamp: | ||
type: long | ||
required: true | ||
description: 'The date the event was processed: for more info https://avro.apache.org/docs/current/spec.html#Local+timestamp+%28microsecond+precision%29' | ||
config: | ||
avroLogicalType: local-timestamp-micros | ||
description: | ||
type: string | ||
required: true | ||
is_processed: | ||
type: boolean | ||
required: true | ||
config: | ||
avroDefault: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters