On Wed, May 17, 2017 at 02:06:28PM +0000, Giovanni GATTI PINHEIRO wrote: > This is the first thing that crossed my mind, but it won’t work (at least > using Avro reflection). I think that the reason is that Crunch will not > deserialize the record to perform sorting and he will instead use a built-in > Avro function to do so. As a result, compareTo will have no effect. This is > pure guessing, I don’t have deep Avro-Crunch knowledge.
Since you are using avro reflection, I don't think you can specify the order (but it's a fairly small patch to ReflectData to implement). If you use indexed records you can specify the sort order[0] which lets you order each record in either ascending, descending, or ignored by field (in order). [0]: https://avro.apache.org/docs/1.8.1/spec.html#order -- Evan McClain http://keybase.io/aeroevan/
signature.asc
Description: PGP signature
