avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Smith <lenov...@gmail.com>
Subject Re: custom attributes
Date Thu, 07 Jan 2016 07:11:54 GMT
Hi Peter,

sorry it was mistype, it should be

{
        "type" :"record",
        "name": "Test",
        "fields": [
            {
            "name": "ROW_ID",
            "title": "row identifier ",
            "type": "integer",


*            "description": "something",,            "ValidityDate":
"2015-01-01",            "ValidityOption": "Delete"*
            },
...


But how you add your own attributes, in your case "primarykey":"true”


Thanks

On Thu, Jan 7, 2016 at 1:16 AM, Peter Lappo <peter.lappo@gmail.com> wrote:

> Yes you can but be careful with the trailing comma - avro parser is quite
> strict and will fail
>
> *"ValidityOption": "Delete",*
>
>
> I use
> {"name":"CUST_ID","type":"string","primarykey":"true”}
> and define the custom attribute in the avsc file
>
>
> On 6 Jan 2016, at 21:11, John Smith <lenovomi@gmail.com> wrote:
>
> Hello,
>
> Im wondering if its allowed to define custom attributes as part of the
> AVRO schema, e.g.
>
>
> {
>         "type" :"record",
>         "name": "Test",
>         "fields": [
>             {
>             "name": "ROW_ID",
>             "title": "row identifier ",
>             "type": "integer",
>
>
> *            "description": "something",,            "ValidityDate":
> "2015-01-01",            "ValidityOption": "Delete",*
>             },
> ...
>
>
> Can I define those three new attributes *description, **ValidityDate, **ValidityOption
> *that extends description of the record "ROW_ID"?
>
>
> Thank you
>
>
>
>

Mime
View raw message