[
https://issues.apache.org/jira/browse/AVRO-2299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16757078#comment-16757078
]
Rumeshkrishnan commented on AVRO-2299:
--------------------------------------
I come to know we can't mixup things parser property and reserved property
seems. for example
Input schema :
{code:java}
{
"type":"record",
"name":"MyRecord",
"namespace":"org.demo",
"fields":[
{
"name":"timestamp_with_logical_type",
"type":{"type":"long","logicalType":"timestamp-millis"},
"user_field_prop": "xxxxx"
},
{
"name":"timestamp_no_logical_type",
"type":"long",
"user_field_prop": "xxxxx"
}
]
}
{code}
Parser Normalised Schema output:
{code:java}
{
"type":"record",
"name":"MyRecord",
"namespace":"org.demo",
"fields":[
{"name":"timestamp_with_logical_type","type":"long"},
{"name":"timestamp_no_logical_type","type":"long"}
]
}
{code}
Canonical Form of Normalised Schema expected output:
{code:java}
{
"type":"record",
"name":"MyRecord",
"namespace":"org.demo",
"fields":[
{"name":"timestamp_with_logical_type","type":{"type":"long","logicalType":"timestamp-millis"}},
{"name":"timestamp_no_logical_type","type":"long"}
]
}
{code}
So, can we create another class for this canonical normaliser so that we are
only form schema with given property as canonical order ?
> Get Plain Schema
> ----------------
>
> Key: AVRO-2299
> URL: https://issues.apache.org/jira/browse/AVRO-2299
> Project: Apache Avro
> Issue Type: New Feature
> Components: java
> Affects Versions: 1.8.2
> Reporter: Rumeshkrishnan
> Priority: Minor
> Labels: features
> Fix For: 1.9.0, 1.8.2, 1.8.3, 1.8.4
>
>
> {panel:title=Avro Schema Reserved Keys:}
> "doc", "fields", "items", "name", "namespace",
> "size", "symbols", "values", "type", "aliases", "default"
> {panel}
> AVRO also supports user defined properties for both Schema and Field.
> Is there way to get the schema with reserved property (key, value)?
> Input Schema:
> {code:java}
> {
> "name": "testSchema",
> "namespace": "com.avro",
> "type": "record",
> "fields": [
> {
> "name": "email",
> "type": "string",
> "doc": "email id",
> "user_field_prop": "xxxxx"
> }
> ],
> "user_schema_prop": "xxxxxx"
> }{code}
> Expected Plain Schema:
> {code:java}
> {
> "name": "testSchema",
> "namespace": "com.avro",
> "type": "record",
> "fields": [
> {
> "name": "email",
> "type": "string",
> "doc": "email id"
> }
> ]
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)