Can I limit the number of rows read by avro-tools?

723 Views Asked by At

I am using avro-tools tojson file.avro to inspect a large Avro file. I am only interested in seeing a few examples, just to get a feeling for the data.

Is there an option for avro-tools tojson that limits the number of rows read?

2

There are 2 best solutions below

1
On BEST ANSWER

Yes, there is an option for avro-tools tojson that limits the number of rows read:

avro-tools tojson --head=<n> <filename>
3
On

No. That's not possible. See source code here. But it should be easy enough to just add a limit to the code. Or just use head to fake it