Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to produce "file" style Avro output #15

Closed
cowtowncoder opened this issue May 7, 2016 · 2 comments
Closed

Add a way to produce "file" style Avro output #15

cowtowncoder opened this issue May 7, 2016 · 2 comments
Labels

Comments

@cowtowncoder
Copy link
Member

(moved from FasterXML/jackson-dataformat-avro#42 by @srini-daruna)

I created avro schema from class and got the byte array and want to write the data to avro file.
How can i do that.?

@cowtowncoder
Copy link
Member Author

(copied my original comment from source issue)

For better or worse, Avro dictates different format for files than network transport -- Avro files are supposed to have both prefix and pre-written schema as JSON. Currently this module only does "raw" encoded content, and does not have means to add wrapper stuff.
Addition of header and avro schema would be a good addition I think.

Note, however, than when transferring Avro content over the wire, these are not supposed to be used. I don't know if spark (et al) would even allow use; perhaps they try to auto-detect which mode is used.

@cowtowncoder
Copy link
Member Author

Implementation added:

AvroGenerator.Feature.AVRO_FILE_OUTPUT

enabling of which will then prepend schema as expected by Avro for "file" format (with header, schema and then payload), instead of "raw" (rfc) format.

@cowtowncoder cowtowncoder changed the title [avro] Could not crate .avro file [avro] Add a way to produce "file" style Avro output Feb 22, 2017
@cowtowncoder cowtowncoder changed the title [avro] Add a way to produce "file" style Avro output Add a way to produce "file" style Avro output Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant