refactor: change predicate API
parent
4ef311dcf3
commit
9d48fd7032
|
@ -215,7 +215,7 @@ impl Column {
|
|||
/// Determine the set of row ids that satisfy the predicate.
|
||||
///
|
||||
/// TODO(edd): row ids pooling.
|
||||
pub fn row_ids_filter(&self, op: cmp::Operator, value: Value<'_>) -> RowIDsOption {
|
||||
pub fn row_ids_filter(&self, op: &cmp::Operator, value: &Value<'_>) -> RowIDsOption {
|
||||
// If we can get an answer using only the meta-data on the column then
|
||||
// return that answer.
|
||||
match self.evaluate_predicate_on_meta(&op, &value) {
|
||||
|
@ -249,8 +249,8 @@ impl Column {
|
|||
/// that are often found on timestamp columns.
|
||||
pub fn row_ids_filter_range(
|
||||
&self,
|
||||
low: (cmp::Operator, Value<'_>),
|
||||
high: (cmp::Operator, Value<'_>),
|
||||
low: (&cmp::Operator, &Value<'_>),
|
||||
high: (&cmp::Operator, &Value<'_>),
|
||||
) -> RowIDsOption {
|
||||
let l = self.evaluate_predicate_on_meta(&low.0, &low.1);
|
||||
let h = self.evaluate_predicate_on_meta(&high.0, &high.1);
|
||||
|
@ -668,7 +668,7 @@ impl StringEncoding {
|
|||
}
|
||||
|
||||
/// Returns the row ids that satisfy the provided predicate.
|
||||
pub fn row_ids_filter(&self, op: cmp::Operator, value: &str, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, op: &cmp::Operator, value: &str, dst: RowIDs) -> RowIDs {
|
||||
match &self {
|
||||
Self::RLE(c) => c.row_ids_filter(value, op, dst),
|
||||
}
|
||||
|
@ -1091,7 +1091,7 @@ impl IntegerEncoding {
|
|||
/// Note: it is the caller's responsibility to ensure that the provided
|
||||
/// `Scalar` value will fit within the physical type of the encoded column.
|
||||
/// `row_ids_filter` will panic if this invariant is broken.
|
||||
pub fn row_ids_filter(&self, op: cmp::Operator, value: &Scalar, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, op: &cmp::Operator, value: &Scalar, dst: RowIDs) -> RowIDs {
|
||||
match &self {
|
||||
Self::I64I64(c) => c.row_ids_filter(value.as_i64(), op, dst),
|
||||
Self::I64I32(c) => c.row_ids_filter(value.as_i32(), op, dst),
|
||||
|
@ -1130,8 +1130,8 @@ impl IntegerEncoding {
|
|||
/// `row_ids_filter` will panic if this invariant is broken.
|
||||
pub fn row_ids_filter_range(
|
||||
&self,
|
||||
low: (cmp::Operator, &Scalar),
|
||||
high: (cmp::Operator, &Scalar),
|
||||
low: (&cmp::Operator, &Scalar),
|
||||
high: (&cmp::Operator, &Scalar),
|
||||
dst: RowIDs,
|
||||
) -> RowIDs {
|
||||
match &self {
|
||||
|
@ -1394,7 +1394,7 @@ impl FloatEncoding {
|
|||
/// Note: it is the caller's responsibility to ensure that the provided
|
||||
/// `Scalar` value will fit within the physical type of the encoded column.
|
||||
/// `row_ids_filter` will panic if this invariant is broken.
|
||||
pub fn row_ids_filter(&self, op: cmp::Operator, value: &Scalar, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, op: &cmp::Operator, value: &Scalar, dst: RowIDs) -> RowIDs {
|
||||
match &self {
|
||||
FloatEncoding::Fixed64(c) => c.row_ids_filter(value.as_f64(), op, dst),
|
||||
FloatEncoding::Fixed32(c) => c.row_ids_filter(value.as_f32(), op, dst),
|
||||
|
@ -1408,8 +1408,8 @@ impl FloatEncoding {
|
|||
/// `row_ids_filter` will panic if this invariant is broken.
|
||||
pub fn row_ids_filter_range(
|
||||
&self,
|
||||
low: (cmp::Operator, &Scalar),
|
||||
high: (cmp::Operator, &Scalar),
|
||||
low: (&cmp::Operator, &Scalar),
|
||||
high: (&cmp::Operator, &Scalar),
|
||||
dst: RowIDs,
|
||||
) -> RowIDs {
|
||||
match &self {
|
||||
|
@ -2446,6 +2446,13 @@ impl RowIDs {
|
|||
RowIDs::Vector(ids) => ids.extend(from..to),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn intersect(&mut self, other: RowIDs) {
|
||||
match (self, other) {
|
||||
(RowIDs::Bitmap(_self), RowIDs::Bitmap(ref other)) => _self.and_inplace(other),
|
||||
(_, _) => unimplemented!("currently unsupported"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -2456,6 +2463,18 @@ mod test {
|
|||
UInt16Array, UInt32Array, UInt64Array, UInt8Array,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn row_ids_intersect() {
|
||||
let mut row_ids = RowIDs::new_bitmap();
|
||||
row_ids.add_range(0, 5);
|
||||
|
||||
let mut other = RowIDs::new_bitmap();
|
||||
other.add_range(2, 7);
|
||||
|
||||
row_ids.intersect(other);
|
||||
assert_eq!(row_ids.to_vec(), vec![2, 3, 4]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn from_arrow_string_array() {
|
||||
let input = vec![None, Some("world"), None, Some("hello")];
|
||||
|
@ -2995,28 +3014,33 @@ mod test {
|
|||
];
|
||||
|
||||
let col = Column::from(&input[..]);
|
||||
let mut row_ids =
|
||||
col.row_ids_filter(cmp::Operator::Equal, Value::String(&"Badlands".to_string()));
|
||||
let mut row_ids = col.row_ids_filter(
|
||||
&cmp::Operator::Equal,
|
||||
&Value::String(&"Badlands".to_string()),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::String(&"Factory".to_string()));
|
||||
row_ids = col.row_ids_filter(
|
||||
&cmp::Operator::Equal,
|
||||
&Value::String(&"Factory".to_string()),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::None));
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::GT,
|
||||
Value::String(&"Adam Raised a Cain".to_string()),
|
||||
&cmp::Operator::GT,
|
||||
&Value::String(&"Adam Raised a Cain".to_string()),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 2, 3, 6]);
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::LTE,
|
||||
Value::String(&"Streets of Fire".to_string()),
|
||||
&cmp::Operator::LTE,
|
||||
&Value::String(&"Streets of Fire".to_string()),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 2, 3, 6]);
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::LT,
|
||||
Value::String(&"Something in the Night".to_string()),
|
||||
&cmp::Operator::LT,
|
||||
&Value::String(&"Something in the Night".to_string()),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 2, 6]);
|
||||
|
||||
|
@ -3031,20 +3055,20 @@ mod test {
|
|||
|
||||
let col = Column::from(&input[..]);
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::NotEqual,
|
||||
Value::String(&"Adam Raised a Cain".to_string()),
|
||||
&cmp::Operator::NotEqual,
|
||||
&Value::String(&"Adam Raised a Cain".to_string()),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::GT,
|
||||
Value::String(&"Adam Raised a Cain".to_string()),
|
||||
&cmp::Operator::GT,
|
||||
&Value::String(&"Adam Raised a Cain".to_string()),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::NotEqual,
|
||||
Value::String(&"Thunder Road".to_string()),
|
||||
&cmp::Operator::NotEqual,
|
||||
&Value::String(&"Thunder Road".to_string()),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
}
|
||||
|
@ -3054,22 +3078,23 @@ mod test {
|
|||
let input = &[100, 200, 300, 2, 200, 22, 30];
|
||||
|
||||
let col = Column::from(&input[..]);
|
||||
let mut row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::I32(200)));
|
||||
let mut row_ids =
|
||||
col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::I32(200)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![1, 4]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::I32(2000)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::I32(2000)));
|
||||
assert!(matches!(row_ids, RowIDsOption::None));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GT, Value::Scalar(Scalar::I32(2)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GT, &Value::Scalar(Scalar::I32(2)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 2, 4, 5, 6]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GTE, Value::Scalar(Scalar::I32(2)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(2)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::NotEqual, Value::Scalar(Scalar::I32(-1257)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::NotEqual, &Value::Scalar(Scalar::I32(-1257)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::LT, Value::Scalar(Scalar::I64(i64::MAX)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::LT, &Value::Scalar(Scalar::I64(i64::MAX)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
let input = vec![
|
||||
|
@ -3083,7 +3108,7 @@ mod test {
|
|||
];
|
||||
let arr = Int64Array::from(input);
|
||||
let col = Column::from(arr);
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GT, Value::Scalar(Scalar::I64(10)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GT, &Value::Scalar(Scalar::I64(10)));
|
||||
println!("{:?}", row_ids);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 4, 5, 6]);
|
||||
}
|
||||
|
@ -3093,19 +3118,20 @@ mod test {
|
|||
let input = &[100_u32, 200, 300, 2, 200, 22, 30];
|
||||
|
||||
let col = Column::from(&input[..]);
|
||||
let mut row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::I32(200)));
|
||||
let mut row_ids =
|
||||
col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::I32(200)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![1, 4]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::U16(2000)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::U16(2000)));
|
||||
assert!(matches!(row_ids, RowIDsOption::None));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GT, Value::Scalar(Scalar::U32(2)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GT, &Value::Scalar(Scalar::U32(2)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 2, 4, 5, 6]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GTE, Value::Scalar(Scalar::U64(2)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GTE, &Value::Scalar(Scalar::U64(2)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::NotEqual, Value::Scalar(Scalar::I32(-1257)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::NotEqual, &Value::Scalar(Scalar::I32(-1257)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
}
|
||||
|
||||
|
@ -3115,21 +3141,21 @@ mod test {
|
|||
|
||||
let col = Column::from(&input[..]);
|
||||
let mut row_ids =
|
||||
col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::F32(200.0)));
|
||||
col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::F32(200.0)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![1]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::Equal, Value::Scalar(Scalar::F64(2000.0)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::Equal, &Value::Scalar(Scalar::F64(2000.0)));
|
||||
assert!(matches!(row_ids, RowIDsOption::None));
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GT, Value::Scalar(Scalar::F64(-200.0)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GT, &Value::Scalar(Scalar::F64(-200.0)));
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 2, 3, 5, 6]);
|
||||
|
||||
row_ids = col.row_ids_filter(cmp::Operator::GTE, Value::Scalar(Scalar::F64(-200.2)));
|
||||
row_ids = col.row_ids_filter(&cmp::Operator::GTE, &Value::Scalar(Scalar::F64(-200.2)));
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter(
|
||||
cmp::Operator::NotEqual,
|
||||
Value::Scalar(Scalar::F32(-1257.029)),
|
||||
&cmp::Operator::NotEqual,
|
||||
&Value::Scalar(Scalar::F32(-1257.029)),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
}
|
||||
|
@ -3140,53 +3166,53 @@ mod test {
|
|||
|
||||
let col = Column::from(&input[..]);
|
||||
let mut row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GT, Value::Scalar(Scalar::I32(100))),
|
||||
(cmp::Operator::LT, Value::Scalar(Scalar::I32(300))),
|
||||
(&cmp::Operator::GT, &Value::Scalar(Scalar::I32(100))),
|
||||
(&cmp::Operator::LT, &Value::Scalar(Scalar::I32(300))),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![1, 4]);
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(200))),
|
||||
(cmp::Operator::LTE, Value::Scalar(Scalar::I32(300))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(200))),
|
||||
(&cmp::Operator::LTE, &Value::Scalar(Scalar::I32(300))),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![1, 2, 4]);
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(23333))),
|
||||
(cmp::Operator::LTE, Value::Scalar(Scalar::I32(999999))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(23333))),
|
||||
(&cmp::Operator::LTE, &Value::Scalar(Scalar::I32(999999))),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::None));
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GT, Value::Scalar(Scalar::I32(-100))),
|
||||
(cmp::Operator::LT, Value::Scalar(Scalar::I32(301))),
|
||||
(&cmp::Operator::GT, &Value::Scalar(Scalar::I32(-100))),
|
||||
(&cmp::Operator::LT, &Value::Scalar(Scalar::I32(301))),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(2))),
|
||||
(cmp::Operator::LTE, Value::Scalar(Scalar::I32(300))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(2))),
|
||||
(&cmp::Operator::LTE, &Value::Scalar(Scalar::I32(300))),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(87))),
|
||||
(cmp::Operator::LTE, Value::Scalar(Scalar::I32(999999))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(87))),
|
||||
(&cmp::Operator::LTE, &Value::Scalar(Scalar::I32(999999))),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 2, 4]);
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(0))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(0))),
|
||||
(
|
||||
cmp::Operator::NotEqual,
|
||||
Value::Scalar(Scalar::I64(i64::MAX)),
|
||||
&cmp::Operator::NotEqual,
|
||||
&Value::Scalar(Scalar::I64(i64::MAX)),
|
||||
),
|
||||
);
|
||||
assert!(matches!(row_ids, RowIDsOption::All));
|
||||
|
||||
row_ids = col.row_ids_filter_range(
|
||||
(cmp::Operator::GTE, Value::Scalar(Scalar::I32(0))),
|
||||
(cmp::Operator::NotEqual, Value::Scalar(Scalar::I64(99))),
|
||||
(&cmp::Operator::GTE, &Value::Scalar(Scalar::I32(0))),
|
||||
(&cmp::Operator::NotEqual, &Value::Scalar(Scalar::I64(99))),
|
||||
);
|
||||
assert_eq!(row_ids.unwrap().to_vec(), vec![0, 1, 2, 3, 4, 5, 6]);
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ impl RLE {
|
|||
|
||||
/// Populates the provided destination container with the row ids satisfying
|
||||
/// the provided predicate.
|
||||
pub fn row_ids_filter(&self, value: &str, op: cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, value: &str, op: &cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
match op {
|
||||
cmp::Operator::Equal | cmp::Operator::NotEqual => self.row_ids_equal(value, op, dst),
|
||||
cmp::Operator::LT | cmp::Operator::LTE | cmp::Operator::GT | cmp::Operator::GTE => {
|
||||
|
@ -216,7 +216,7 @@ impl RLE {
|
|||
}
|
||||
|
||||
// Finds row ids based on = or != operator.
|
||||
fn row_ids_equal(&self, value: &str, op: cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
fn row_ids_equal(&self, value: &str, op: &cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
dst.clear();
|
||||
let include = match op {
|
||||
cmp::Operator::Equal => true,
|
||||
|
@ -254,7 +254,7 @@ impl RLE {
|
|||
}
|
||||
|
||||
// Finds row ids based on <, <=, > or >= operator.
|
||||
fn row_ids_cmp(&self, value: &str, op: cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
fn row_ids_cmp(&self, value: &str, op: &cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
dst.clear();
|
||||
|
||||
// happy path - the value exists in the column
|
||||
|
@ -287,7 +287,7 @@ impl RLE {
|
|||
for (other, other_encoded_id) in &self.entry_index {
|
||||
if other.as_str() > value {
|
||||
// change filter from either `x > value` or `x >= value` to `x >= other`
|
||||
return self.row_ids_cmp(other, cmp::Operator::GTE, dst);
|
||||
return self.row_ids_cmp(other, &cmp::Operator::GTE, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ impl RLE {
|
|||
for (other, other_encoded_id) in self.entry_index.iter().rev() {
|
||||
if other.as_str() < value {
|
||||
// change filter from either `x < value` or `x <= value` to `x <= other`
|
||||
return self.row_ids_cmp(other, cmp::Operator::LTE, dst);
|
||||
return self.row_ids_cmp(other, &cmp::Operator::LTE, dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -998,20 +998,20 @@ mod test {
|
|||
drle.push_none(); // 9
|
||||
drle.push_additional(Some("south".to_string()), 2); // 10, 11
|
||||
|
||||
let ids = drle.row_ids_filter(&"east", cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east", &cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2, 4, 5, 6, 7, 8]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"south", cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"south", &cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![10, 11]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"foo", cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"foo", &cmp::Operator::Equal, RowIDs::Vector(vec![]));
|
||||
assert!(ids.is_empty());
|
||||
|
||||
// != some value not in the column should exclude the NULL value.
|
||||
let ids = drle.row_ids_filter(&"foo", cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"foo", &cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"east", cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east", &cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![3, 10, 11]));
|
||||
}
|
||||
|
||||
|
@ -1021,7 +1021,7 @@ mod test {
|
|||
drle.push_additional(Some("east".to_string()), 2);
|
||||
drle.push_additional(Some("west".to_string()), 1);
|
||||
|
||||
let ids = drle.row_ids_filter(&"abba", cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"abba", &cmp::Operator::NotEqual, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2]));
|
||||
}
|
||||
|
||||
|
@ -1037,23 +1037,23 @@ mod test {
|
|||
drle.push_none(); // 13
|
||||
drle.push_additional(Some("west".to_string()), 5); // 14, 15, 16, 17, 18
|
||||
|
||||
let ids = drle.row_ids_filter(&"east", cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east", &cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2, 4, 5, 6, 7, 8]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"east", cmp::Operator::LT, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east", &cmp::Operator::LT, RowIDs::Vector(vec![]));
|
||||
assert!(ids.is_empty());
|
||||
|
||||
let ids = drle.row_ids_filter(&"north", cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"north", &cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![9, 10, 11, 14, 15, 16, 17, 18]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"north", cmp::Operator::GTE, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"north", &cmp::Operator::GTE, RowIDs::Vector(vec![]));
|
||||
assert_eq!(
|
||||
ids,
|
||||
RowIDs::Vector(vec![3, 9, 10, 11, 12, 14, 15, 16, 17, 18])
|
||||
);
|
||||
|
||||
// The encoding also supports comparisons on values that don't directly exist in the column.
|
||||
let ids = drle.row_ids_filter(&"abba", cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"abba", &cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
assert_eq!(
|
||||
ids,
|
||||
RowIDs::Vector(vec![
|
||||
|
@ -1061,25 +1061,25 @@ mod test {
|
|||
])
|
||||
);
|
||||
|
||||
let ids = drle.row_ids_filter(&"east1", cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east1", &cmp::Operator::GT, RowIDs::Vector(vec![]));
|
||||
assert_eq!(
|
||||
ids,
|
||||
RowIDs::Vector(vec![3, 9, 10, 11, 12, 14, 15, 16, 17, 18])
|
||||
);
|
||||
|
||||
let ids = drle.row_ids_filter(&"east1", cmp::Operator::GTE, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east1", &cmp::Operator::GTE, RowIDs::Vector(vec![]));
|
||||
assert_eq!(
|
||||
ids,
|
||||
RowIDs::Vector(vec![3, 9, 10, 11, 12, 14, 15, 16, 17, 18])
|
||||
);
|
||||
|
||||
let ids = drle.row_ids_filter(&"east1", cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"east1", &cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2, 4, 5, 6, 7, 8]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"region", cmp::Operator::LT, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"region", &cmp::Operator::LT, RowIDs::Vector(vec![]));
|
||||
assert_eq!(ids, RowIDs::Vector(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 12]));
|
||||
|
||||
let ids = drle.row_ids_filter(&"zoo", cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
let ids = drle.row_ids_filter(&"zoo", &cmp::Operator::LTE, RowIDs::Vector(vec![]));
|
||||
assert_eq!(
|
||||
ids,
|
||||
RowIDs::Vector(vec![
|
||||
|
|
|
@ -266,7 +266,7 @@ where
|
|||
/// value.
|
||||
///
|
||||
/// Essentially, this supports `value {=, !=, >, >=, <, <=} x`.
|
||||
pub fn row_ids_filter(&self, value: T, op: cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, value: T, op: &cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
match op {
|
||||
cmp::Operator::GT => self.row_ids_cmp_order(&value, PartialOrd::gt, dst),
|
||||
cmp::Operator::GTE => self.row_ids_cmp_order(&value, PartialOrd::ge, dst),
|
||||
|
@ -290,7 +290,7 @@ where
|
|||
// Handles finding all rows that match the provided operator on `value`.
|
||||
// For performance reasons ranges of matching values are collected up and
|
||||
// added in bulk to the bitmap.
|
||||
fn row_ids_equal(&self, value: &T, op: cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
fn row_ids_equal(&self, value: &T, op: &cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
dst.clear();
|
||||
|
||||
let desired;
|
||||
|
@ -386,8 +386,8 @@ where
|
|||
/// `x {>, >=, <, <=} value1 AND x {>, >=, <, <=} value2`.
|
||||
pub fn row_ids_filter_range(
|
||||
&self,
|
||||
left: (T, cmp::Operator),
|
||||
right: (T, cmp::Operator),
|
||||
left: (T, &cmp::Operator),
|
||||
right: (T, &cmp::Operator),
|
||||
dst: RowIDs,
|
||||
) -> RowIDs {
|
||||
match (&left.1, &right.1) {
|
||||
|
@ -671,16 +671,16 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::Equal, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![0, 2, 12]);
|
||||
|
||||
let dst = v.row_ids_filter(101, Operator::Equal, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(101, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![1, 8]);
|
||||
|
||||
let dst = v.row_ids_filter(2030, Operator::Equal, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(2030, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![6]);
|
||||
|
||||
let dst = v.row_ids_filter(194, Operator::Equal, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(194, &Operator::Equal, RowIDs::new_vector());
|
||||
assert!(dst.is_empty());
|
||||
}
|
||||
|
||||
|
@ -689,22 +689,22 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::NotEqual, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![1, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
|
||||
let dst = v.row_ids_filter(101, Operator::NotEqual, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(101, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(
|
||||
dst.unwrap_vector(),
|
||||
&vec![0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12]
|
||||
);
|
||||
|
||||
let dst = v.row_ids_filter(2030, Operator::NotEqual, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(2030, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(
|
||||
dst.unwrap_vector(),
|
||||
&vec![0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12]
|
||||
);
|
||||
|
||||
let dst = v.row_ids_filter(194, Operator::NotEqual, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(194, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &(0..13).collect::<Vec<u32>>());
|
||||
}
|
||||
|
||||
|
@ -713,10 +713,10 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::LT, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::LT, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![7, 9, 10, 11]);
|
||||
|
||||
let dst = v.row_ids_filter(3, Operator::LT, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(3, &Operator::LT, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
@ -725,10 +725,10 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::LTE, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::LTE, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![0, 2, 7, 9, 10, 11, 12]);
|
||||
|
||||
let dst = v.row_ids_filter(2, Operator::LTE, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(2, &Operator::LTE, RowIDs::new_vector());
|
||||
assert!(dst.is_empty());
|
||||
}
|
||||
|
||||
|
@ -737,10 +737,10 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::GT, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::GT, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![1, 3, 4, 5, 6, 8]);
|
||||
|
||||
let dst = v.row_ids_filter(2030, Operator::GT, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(2030, &Operator::GT, RowIDs::new_vector());
|
||||
assert!(dst.is_empty());
|
||||
}
|
||||
|
||||
|
@ -749,10 +749,10 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter(100, Operator::GTE, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(100, &Operator::GTE, RowIDs::new_vector());
|
||||
assert_eq!(dst.unwrap_vector(), &vec![0, 1, 2, 3, 4, 5, 6, 8, 12]);
|
||||
|
||||
let dst = v.row_ids_filter(2031, Operator::GTE, RowIDs::new_vector());
|
||||
let dst = v.row_ids_filter(2031, &Operator::GTE, RowIDs::new_vector());
|
||||
assert!(dst.is_empty());
|
||||
}
|
||||
|
||||
|
@ -762,36 +762,36 @@ mod test {
|
|||
v.values = vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100];
|
||||
|
||||
let dst = v.row_ids_filter_range(
|
||||
(100, Operator::GTE),
|
||||
(240, Operator::LT),
|
||||
(100, &Operator::GTE),
|
||||
(240, &Operator::LT),
|
||||
RowIDs::new_vector(),
|
||||
);
|
||||
assert_eq!(dst.unwrap_vector(), &vec![0, 1, 2, 3, 8, 12]);
|
||||
|
||||
let dst = v.row_ids_filter_range(
|
||||
(100, Operator::GT),
|
||||
(240, Operator::LT),
|
||||
(100, &Operator::GT),
|
||||
(240, &Operator::LT),
|
||||
RowIDs::new_vector(),
|
||||
);
|
||||
assert_eq!(dst.unwrap_vector(), &vec![1, 3, 8]);
|
||||
|
||||
let dst = v.row_ids_filter_range(
|
||||
(10, Operator::LT),
|
||||
(-100, Operator::GT),
|
||||
(10, &Operator::LT),
|
||||
(-100, &Operator::GT),
|
||||
RowIDs::new_vector(),
|
||||
);
|
||||
assert_eq!(dst.unwrap_vector(), &vec![7, 9, 10]);
|
||||
|
||||
let dst = v.row_ids_filter_range(
|
||||
(21, Operator::GTE),
|
||||
(21, Operator::LTE),
|
||||
(21, &Operator::GTE),
|
||||
(21, &Operator::LTE),
|
||||
RowIDs::new_vector(),
|
||||
);
|
||||
assert_eq!(dst.unwrap_vector(), &vec![11]);
|
||||
|
||||
let dst = v.row_ids_filter_range(
|
||||
(10000, Operator::LTE),
|
||||
(3999, Operator::GT),
|
||||
(10000, &Operator::LTE),
|
||||
(3999, &Operator::GT),
|
||||
RowIDs::new_bitmap(),
|
||||
);
|
||||
assert!(dst.is_empty());
|
||||
|
@ -799,8 +799,8 @@ mod test {
|
|||
let mut v: Fixed<i64> = Fixed::default();
|
||||
v.values = vec![100, 200, 300, 2, 200, 22, 30];
|
||||
let dst = v.row_ids_filter_range(
|
||||
(200, Operator::GTE),
|
||||
(300, Operator::LTE),
|
||||
(200, &Operator::GTE),
|
||||
(300, &Operator::LTE),
|
||||
RowIDs::new_vector(),
|
||||
);
|
||||
assert_eq!(dst.unwrap_vector(), &vec![1, 2, 4]);
|
||||
|
|
|
@ -276,7 +276,7 @@ where
|
|||
/// Essentially, this supports `value {=, !=, >, >=, <, <=} x`.
|
||||
///
|
||||
/// The equivalent of `IS NULL` is not currently supported via this method.
|
||||
pub fn row_ids_filter(&self, value: T::Native, op: cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
pub fn row_ids_filter(&self, value: T::Native, op: &cmp::Operator, dst: RowIDs) -> RowIDs {
|
||||
match op {
|
||||
cmp::Operator::GT => self.row_ids_cmp_order(value, Self::ord_from_op(&op), dst),
|
||||
cmp::Operator::GTE => self.row_ids_cmp_order(value, Self::ord_from_op(&op), dst),
|
||||
|
@ -300,7 +300,7 @@ where
|
|||
// Handles finding all rows that match the provided operator on `value`.
|
||||
// For performance reasons ranges of matching values are collected up and
|
||||
// added in bulk to the bitmap.
|
||||
fn row_ids_equal(&self, value: T::Native, op: cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
fn row_ids_equal(&self, value: T::Native, op: &cmp::Operator, mut dst: RowIDs) -> RowIDs {
|
||||
dst.clear();
|
||||
|
||||
let desired;
|
||||
|
@ -683,16 +683,16 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::Equal, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![0, 2, 12]);
|
||||
|
||||
let row_ids = v.row_ids_filter(101, Operator::Equal, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(101, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![1, 8]);
|
||||
|
||||
let row_ids = v.row_ids_filter(2030, Operator::Equal, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(2030, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![6]);
|
||||
|
||||
let row_ids = v.row_ids_filter(194, Operator::Equal, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(194, &Operator::Equal, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
@ -702,19 +702,19 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::NotEqual, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![1, 3, 4, 5, 6, 7, 8, 9, 10, 11]);
|
||||
|
||||
let row_ids = v.row_ids_filter(101, Operator::NotEqual, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(101, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12]);
|
||||
|
||||
let row_ids = v.row_ids_filter(2030, Operator::NotEqual, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(2030, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(
|
||||
row_ids.to_vec(),
|
||||
vec![0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12]
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(194, Operator::NotEqual, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(194, &Operator::NotEqual, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), (0..13).collect::<Vec<u32>>());
|
||||
}
|
||||
|
||||
|
@ -724,10 +724,10 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::LT, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::LT, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![7, 9, 10, 11]);
|
||||
|
||||
let row_ids = v.row_ids_filter(3, Operator::LT, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(3, &Operator::LT, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
@ -737,10 +737,10 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::LTE, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::LTE, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![0, 2, 7, 9, 10, 11, 12]);
|
||||
|
||||
let row_ids = v.row_ids_filter(2, Operator::LTE, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(2, &Operator::LTE, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
@ -750,10 +750,10 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::GT, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::GT, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![1, 3, 4, 5, 6, 8]);
|
||||
|
||||
let row_ids = v.row_ids_filter(2030, Operator::GT, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(2030, &Operator::GT, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
@ -772,10 +772,10 @@ mod test {
|
|||
.as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(10, Operator::GT, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(10, &Operator::GT, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![0, 1, 4, 5, 6]);
|
||||
|
||||
let row_ids = v.row_ids_filter(30, Operator::LTE, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(30, &Operator::LTE, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![5, 6]);
|
||||
}
|
||||
|
||||
|
@ -785,10 +785,10 @@ mod test {
|
|||
vec![100, 101, 100, 102, 1000, 300, 2030, 3, 101, 4, 5, 21, 100].as_slice(),
|
||||
);
|
||||
|
||||
let row_ids = v.row_ids_filter(100, Operator::GTE, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(100, &Operator::GTE, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), vec![0, 1, 2, 3, 4, 5, 6, 8, 12]);
|
||||
|
||||
let row_ids = v.row_ids_filter(2031, Operator::GTE, RowIDs::new_vector());
|
||||
let row_ids = v.row_ids_filter(2031, &Operator::GTE, RowIDs::new_vector());
|
||||
assert_eq!(row_ids.to_vec(), Vec::<u32>::new());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue