flink-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: load avro example
Date Mon, 22 Sep 2014 12:34:37 GMT
Hi Martin!

Using Avro-formatted data should be straightforward with the
AvroInputformat (
https://github.com/apache/incubator-flink/blob/master/flink-addons/flink-avro/src/main/java/org/apache/flink/api/java/io/AvroInputFormat.java
)

Just add "flink-avro" as a Maven dependency and create a DataSet using

ExecutionEnvironment.createInput(new AvroInputFormat<MyAvroType>(new Path(
"/path/to/file"), MyAvroType.class));

You can also have a look at line 225 here:
https://github.com/apache/incubator-flink/blob/master/flink-addons/flink-avro/src/test/java/org/apache/flink/api/avro/testjar/AvroExternalJarProgram.java#L225

Greetings,
Stephan


On Mon, Sep 22, 2014 at 2:16 PM, Martin Neumann <mneumann@spotify.com>
wrote:

> Hej,
>
> I'm looking for some example code on how to load a avro formatted data set.
>
> I have the Avro Schema (its horrible twisted and nested on several levels)
> and I want to load that into java classes to make it easier to process.
>
> I'm using Flink 0.7 latest snapshot.
>
>
> thanks for the help
> cheers Martin
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message