You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@avro.apache.org by Luis Trigueiros <lu...@gmail.com> on 2016/12/01 22:59:06 UTC

Example handling joda time ?

Hi,

Nu I now there is support for Joda time and date as logical types, but I
can't find one example where a schema is declared for a record or class
where one of the attribute is a joda time date.
Does anyone have this example, help would be appreciated.

Thank you.
 Oscar

Re: Example handling joda time ?

Posted by Yibing Shi <ys...@cloudera.com>.
Hi Oscar,

You don't have to specify in schema that you are going to use Joda types.
Just define the schema as a logical type:

{"type":"int","logicalType":"date"}
{"type":"int","logicalType":"time-millis"}
{"type":"long","logicalType":"timestamp-millis"}

Please check TimeConvertions class for those conversions defined for above
types.

*Yibing Shi*
*Customer Operations Engineer*
<http://www.cloudera.com>

On Fri, Dec 2, 2016 at 9:59 AM, Luis Trigueiros <lu...@gmail.com>
wrote:

> Hi,
>
> Nu I now there is support for Joda time and date as logical types, but I
> can't find one example where a schema is declared for a record or class
> where one of the attribute is a joda time date.
> Does anyone have this example, help would be appreciated.
>
> Thank you.
>  Oscar
>