[
https://issues.apache.org/jira/browse/AVRO-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373418#comment-16373418
]
Zoltan Farkas commented on AVRO-2132:
-------------------------------------
[~cutting] [~kdrakon]
I just looked at this commit and tried to apply it to my fork.. and since my
fork does not allow invalid default values defined in schemas/idl, the changes
made here break the unit tests in the fork.....
here is where the issue is:
the new declared fields in simple.avdl do not have default values:
{code}
record TestRecord {
...............
@foo.bar("bar.foo") long l;
union {null, @foo.foo.bar(42) @foo.foo.foo("3foo") string}
nested_properties;
{code}
and as such the method declaration bellow is invalid:
TestRecord echo(TestRecord `record` = {"name":"bar","kind":"BAR"});
and to be correct since the new added fields do not have defaults it should be
something like:
TestRecord echo(TestRecord `record` =
{"name":"bar","kind":"BAR","l":0,"nested_properties":null});
I thought https://issues.apache.org/jira/browse/AVRO-2035 is resolved?
worthwhile to look into this... cheers.
> Avro IDL: Support dot ('.') character in property annotation names
> ------------------------------------------------------------------
>
> Key: AVRO-2132
> URL: https://issues.apache.org/jira/browse/AVRO-2132
> Project: Avro
> Issue Type: Improvement
> Components: java
> Affects Versions: 1.8.2
> Reporter: Sean Policarpio
> Assignee: Doug Cutting
> Priority: Major
> Fix For: 1.9.0
>
>
> Unless there is a strong reason why names like {{@foo.bar}} can't be used as
> property annotations in IDL, I propose an enhancement to the IDL parser to
> allow it.
> The major drive for this change comes from Kafka Connect; for a certain
> fields – namely timestamps – additional metadata must be present in the
> schema when certain consumers read the data (e.g. [the JDBC
> connector|https://github.com/confluentinc/kafka-connect-jdbc]). What I hoped
> when using IDL was to write the following for a record field:
> {code:java}
> union {null, @connect.version(1)
> @connect.name("org.apache.kafka.connect.data.Timestamp") long}
> queryTime;{code}
> so that the following would be available in the schemata:
> {code:java}
> {
> "name": "queryTime",
> "type": [
> "null",
> {
> "type": "long",
> "connect.version": 1,
> "connect.name": "org.apache.kafka.connect.data.Timestamp"
> }
> ],
> "default": null
> }{code}
> Unfortunately, both {{connect.version}} and {{connect.name}} are unacceptable
> by the parser.
> The change for this is quite minimal as it can be based on AVRO-1267.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)