Details
Description
This patch allows to add additional optional comparator informations to the avro schema for record types.
An example is included in the patch
CompoundDataExportKeyExtended2.avsc
...snip...
{"name": "seqNo", "type": "int", "comparators" : [
,
,
{ "name":"grouping2", "compareIdx" : 3, "order":"ignore" } ]},
...snip...
in the comparators property of a field definition multiple compartor informations can be defined. Often used when defining GroupingCompartors with compound keys is order="ignore" so that the keys are just compared with respect to some special (not ignored fields)
The necessary changes are made in GenericData class with a fall back to the standard behavior if no comparators are defined.
An example generic Compartor is delivered with this patch called:
org.woopi.avro.GenericComparator
Maybe this class can be included in the avro bundle. In this case the package can be adapted to org.apache.
The TestCase tests several different situations and is called.
TestGenericComparator.java