sxt-proof-of-sql
sxt-proof-of-sql copied to clipboard
Expand `column_operation.rs` to include column-literal operations
Background and Motivation
We need to expand column_operation.rs to include column-literal operations so that we can define accurate and fast operations on ColumnarValue
s.
Changes Required
- [ ] Add the following functions to
column_operation.rs
or start a separatecolumn_literal_operation.rs
. - [ ] Make sure the code is well tested.
Examples of functions we need:
pub(super) fn slice_literal_and(slice: &[bool], lit: bool) -> Vec<bool>;
pub(super) fn slice_literal_or(slice: &[bool], lit: bool) -> Vec<bool>;
pub(super) fn slice_literal_eq<T>(slice: &[T], lit: T) -> Vec<T>
where
T: PartialEq + Debug;
pub(super) fn slice_literal_le_casting_slice<SmallerType, LargerType>(
slice_of_smaller_type: &[SmallerType],
literal_of_larger_type: LargerType,
) -> Vec<bool>
where
SmallerType: Copy + Debug + Into<LargerType>,
LargerType: PartialOrd + Copy + Debug;
pub(super) fn slice_literal_le_casting_literal<SmallerType, LargerType>(
slice_of_larger_type: &[LargerType],
literal_of_smaller_type: SmallerType,
) -> Vec<bool>
where
SmallerType: Copy + Debug + Into<LargerType>,
LargerType: PartialOrd + Copy + Debug;