Class AvroBinaryComparer
Compares Avro binary data by the specification's sort order for one schema, without decoding it, as Apache Avro
Java's BinaryData.compare does (and as Hadoop sorts by it). Both inputs are read at once, only as far as the
first difference. Instances are cached per schema and are thread-safe.
public sealed class AvroBinaryComparer : IComparer<byte[]?>
- Inheritance
-
AvroBinaryComparer
- Implements
- Inherited Members
Remarks
The order is AvroValueComparer's: two encoded values compare as their decoded values do. Data after the value is ignored.
The input is read with the limits of GenericDatumReaderOptions: records nested deeper than MaxDepth, or more zero-size array or map items than MaxZeroSizeItems, are rejected with AvroDataException.
Properties
- Schema
Gets the schema the data is written with.
Methods
- Compare(ReadOnlySpan<byte>, ReadOnlySpan<byte>)
Compares two values encoded with Schema.
- Create(AvroSchema, GenericDatumReaderOptions?)
Gets the comparer for
schema, compiling it on first use. Comparers with the default options are cached per schema; comparers with custom options are created each time, so keep and reuse them.