[ 
https://issues.apache.org/jira/browse/AVRO-2132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16373722#comment-16373722
 ] 

ASF GitHub Bot commented on AVRO-2132:
--------------------------------------

kdrakon closed pull request #287: AVRO-2132 added missing defaults for new 
fields
URL: https://github.com/apache/avro/pull/287
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/java/compiler/src/test/idl/input/simple.avdl 
b/lang/java/compiler/src/test/idl/input/simple.avdl
index 1bfcd7b27..d41d7116f 100644
--- a/lang/java/compiler/src/test/idl/input/simple.avdl
+++ b/lang/java/compiler/src/test/idl/input/simple.avdl
@@ -50,8 +50,8 @@ protocol Simple {
     date d = 0;
     time_ms t = 0;
 
-    @foo.bar("bar.foo") long l;
-    union {null, @foo.foo.bar(42) @foo.foo.foo("3foo") string} 
nested_properties;
+    @foo.bar("bar.foo") long l = 0;
+    union {null, @foo.foo.bar(42) @foo.foo.foo("3foo") string} 
nested_properties = null;
   }
 
   error TestError {
diff --git a/lang/java/compiler/src/test/idl/output/simple.avpr 
b/lang/java/compiler/src/test/idl/output/simple.avpr
index f40030790..e315d7851 100644
--- a/lang/java/compiler/src/test/idl/output/simple.avpr
+++ b/lang/java/compiler/src/test/idl/output/simple.avpr
@@ -56,10 +56,12 @@
       "default": 0
     } , {
       "name": "l",
-      "type": {"type": "long", "foo.bar": "bar.foo"}
+      "type": {"type": "long", "foo.bar": "bar.foo"},
+      "default": 0
     } , {
       "name": "nested_properties",
-      "type": [ "null" , {"type":"string", "foo.foo.bar": 42, "foo.foo.foo": 
"3foo"} ]
+      "type": [ "null" , {"type":"string", "foo.foo.bar": 42, "foo.foo.foo": 
"3foo"} ],
+      "default": null
     }],
     "my-property" : {
       "key" : 3


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> 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)

Reply via email to