You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Michael A. Smith (Jira)" <ji...@apache.org> on 2019/10/13 01:47:00 UTC

[jira] [Updated] (AVRO-1980) Write to Avro File in Bulk

     [ https://issues.apache.org/jira/browse/AVRO-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael A. Smith updated AVRO-1980:
-----------------------------------
    Component/s:     (was: build)

> Write to Avro File in Bulk 
> ---------------------------
>
>                 Key: AVRO-1980
>                 URL: https://issues.apache.org/jira/browse/AVRO-1980
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.8.1
>            Reporter: Santosh Balasubramanya
>            Priority: Major
>
> 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
(v8.3.4#803005)