google / riegeli

Riegeli/records is a file format for storing a sequence of string records, typically serialized protocol buffers.
Apache License 2.0
418 stars 53 forks source link

Provide examples #1

Open kirakira opened 5 years ago

kirakira commented 5 years ago

Could you give an example of writing records to a file and reading the data back? I'm reading the code but the API seems fairly complex..

bzz commented 5 years ago

There seem to be an example of reading a file in Riegeli format at Benchmarks::ReadRiegeli.

kirakira commented 5 years ago

Thanks, I was hoping the examples to be more discoverable, but this is good enough to me.

dayfine commented 4 years ago

RecordWriter and RecordReader would be the class to use. https://github.com/google/riegeli/blob/master/riegeli/records/record_writer.h#L477

And the python API has a minimum example: https://github.com/google/riegeli/blob/master/python/riegeli/records/examples/write_read_records.py

alexsteele commented 2 years ago

+1. The templated headers are tricky to read, and many of the tests have indirection that makes common use cases difficult to figure out. e.g. How do you read a CSV file?