Skip to content

Add Compare to GroupByScalar #364

@tustvold

Description

@tustvold

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions