[ https://issues.apache.org/jira/browse/AVRO-1980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15831730#comment-15831730 ]
Santosh Balasubramanya edited comment on AVRO-1980 at 1/23/17 1:38 PM: ----------------------------------------------------------------------- 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 using schema? Thanks, was (Author: contactsanto...@gmail.com): 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)