Skip to content

Expressions becomes enum, ComputeFn becomes ScalarFn #3453

@gatesn

Description

@gatesn

This issue encapsulates a few changes, but I believe the end state makes sense!

  • We should redefine ComputeFn to mean ScalarFn. This let's us make some nice assumptions and keep the trait tightly defined.
  • Add an AggFn to cover our current aggregation functions, e.g. sum, count, min, max.
  • Make a Vortex Expression and enum with a ScalarFn variant.
  • Any expression that can be implemented as a ScalarFn should be. Note that functions that require short-circuiting, e.g. AND, OR, should have their own entry in the enum, rather than delegate to the scalar function.
  • While ScalarFn::Options doesn't need to be serializable (we should support invoking compute functions with opaque runtime options data), a ScalarFn wrapped in an Expression does need to be serializable. This is because...
  • ...Expression is serializable as a well-defined protobuf union. This is one way we can create expressions over the C API.
  • FilterFn and TakeFn should be added to the ArrayOperations trait (returns Result<Option<Array>> since they're optionally implemented) since they're not scalar functions.
  • Vortex Session holds a registry of compute functions that are used when deserializing the protobuf to load the actual implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions