Skip to content

Use Specialization Instead of ScalarValue Binary Operations #6842

Open
@tustvold

Description

@tustvold

Is your feature request related to a problem or challenge?

Currently a number of operations are implemented directly on ScalarValue, including:

  • Arithmetic
  • Logical And
  • Logical Or
  • BitAnd, BitXor, etc...
  • Comparison

Not only does this result in a huge amount of code, but also these operations don't behave the same way as their array counterparts.

For example:

  • An operation on a null doesn't yield a null
  • Floating point NaNs are not total ordered
  • No support for decimals
  • Differing support for interval arithmetic compared to the array kernels

Describe the solution you'd like

These kernels largely appear to exist for the purposes of aggregation, where the aggregated types are known statically. We should replace these uses with specialization, as done in #6800 (comment). The remaining uses should make use of the new Datum abstraction apache/arrow-rs#4393 to use the same arrow-rs kernels apache/arrow-rs#4465

Describe alternatives you've considered

No response

Additional context

#4973 tracks improving the aggregator performance
#6832 updates DF to use the Datum kernels

Metadata

Metadata

Assignees

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