Whilst looking to implement #141 I couldn't work out a way to compare ScalarValue types.
There is, however, GroupByScalar which seems pretty compelling:
- It lacks an internal Option, allowing the caller to handle null-ordering how it deems fit
- It uses OrderedFloat, establishing a standards compliant ordering of floats
- It only provides the value variants that make sense to compare
- The plumbing to convert from a
ScalarValue already exists
It therefore seems to be what I'm looking for, however, it doesn't currently have a PartialOrd or Ord implementation and is crate-local...
Based on this I have a couple of questions:
- Is there some other mechanism I should use to compare fields across record batches (at potentially different row offsets)
- Can we add
#[derive(PartialOrd, Ord)] to GroupByScalar - note this would establish an ordering based on the order of enum variants between unrelated variants
- Can we expose
GroupByScalar publicly, potentially renamed to something to reflect its more generic utility, perhaps ComparableScalar or something