avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Santosh Balasubramanya (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AVRO-1980) Write to Avro File in Bulk
Date Fri, 20 Jan 2017 13:21:26 GMT

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

Santosh Balasubramanya commented on AVRO-1980:
----------------------------------------------

Usually when we write to a file we buffer the data and then flush it .
I that possible using Avro?
One more important this can we store Avro data in file with ut schema?

Thanks,

> Write to Avro File in Bulk 
> ---------------------------
>
>                 Key: AVRO-1980
>                 URL: https://issues.apache.org/jira/browse/AVRO-1980
>             Project: Avro
>          Issue Type: Improvement
>          Components: build, java
>    Affects Versions: 1.8.1
>            Reporter: Santosh Balasubramanya
>
> when writing to Avro files usually append happens record by record.
> Can't it be done by buffering and then committing it to file?
>  Below example
> DatumWriter<User> userDatumWriter = new SpecificDatumWriter<User>(User.class);
> DataFileWriter<User> dataFileWriter = new DataFileWriter<User>(userDatumWriter);
> dataFileWriter.create(user1.getSchema(), new File("users.avro"));
> dataFileWriter.append(user1);
> dataFileWriter.append(user2);
> dataFileWriter.append(user3);
> dataFileWriter.close();
>       



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message