Merge branch 'main' into ntran/field_columns_tests

pull/24376/head
kodiakhq[bot] 2021-10-22 16:50:35 +00:00 committed by GitHub
commit 5d3e838475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -1026,6 +1026,7 @@ mod test {
.field("sketchy_sensor", Int64) .field("sketchy_sensor", Int64)
.non_null_field("active", Boolean) .non_null_field("active", Boolean)
.field("msg", Utf8) .field("msg", Utf8)
.field("all_null", Utf8)
.timestamp() .timestamp()
.build() .build()
.unwrap(); .unwrap();
@ -1049,6 +1050,7 @@ mod test {
Some("message b"), Some("message b"),
None, None,
])), ])),
Arc::new(StringArray::from(vec![None, None, None])),
Arc::new(TimestampNanosecondArray::from_vec( Arc::new(TimestampNanosecondArray::from_vec(
vec![i, 2 * i, 3 * i], vec![i, 2 * i, 3 * i],
None, None,
@ -1110,6 +1112,7 @@ mod test {
); );
assert_rb_column_equals(&first_row_group, "active", &exp_active_values); assert_rb_column_equals(&first_row_group, "active", &exp_active_values);
assert_rb_column_equals(&first_row_group, "msg", &exp_msg_values); assert_rb_column_equals(&first_row_group, "msg", &exp_msg_values);
assert_rb_column_equals(&first_row_group, "all_null", &Values::String(vec![None]));
assert_rb_column_equals(&first_row_group, "time", &Values::I64(vec![100])); // first row from first record batch assert_rb_column_equals(&first_row_group, "time", &Values::I64(vec![100])); // first row from first record batch
let second_row_group = itr.next().unwrap(); let second_row_group = itr.next().unwrap();
@ -1122,8 +1125,16 @@ mod test {
&exp_sketchy_sensor_values, &exp_sketchy_sensor_values,
); );
assert_rb_column_equals(&first_row_group, "active", &exp_active_values); assert_rb_column_equals(&first_row_group, "active", &exp_active_values);
assert_rb_column_equals(&first_row_group, "all_null", &Values::String(vec![None]));
assert_rb_column_equals(&second_row_group, "time", &Values::I64(vec![200])); // first row from second record batch assert_rb_column_equals(&second_row_group, "time", &Values::I64(vec![200])); // first row from second record batch
// No rows returned when filtering on all_null column
let predicate = Predicate::new(vec![BinaryExpr::from(("all_null", "!=", "a string"))]);
let mut itr = chunk
.read_filter(predicate, Selection::All, vec![])
.unwrap();
assert!(itr.next().is_none());
// Error when predicate is invalid // Error when predicate is invalid
let predicate = let predicate =
Predicate::with_time_range(&[BinaryExpr::from(("env", "=", 22.3))], 100, 205); Predicate::with_time_range(&[BinaryExpr::from(("env", "=", 22.3))], 100, 205);