Skip to content

Commit d39c4e8

Browse files
committed
up
1 parent d50a744 commit d39c4e8

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎native-engine/auron-serde/src/from_proto.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,12 +1292,12 @@ impl From<&protobuf::ColumnStats> for ColumnStatistics {
12921292
max_value: cs
12931293
.max_value
12941294
.as_ref()
1295-
.map(|m| Precision::Exact(m.try_into().expect("max_value")))
1295+
.map(|m| Precision::Exact(m.try_into().expect("invalid max_value")))
12961296
.unwrap_or(Precision::Absent),
12971297
min_value: cs
12981298
.min_value
12991299
.as_ref()
1300-
.map(|m| Precision::Exact(m.try_into().expect("min_value")))
1300+
.map(|m| Precision::Exact(m.try_into().expect("invalid min_value")))
13011301
.unwrap_or(Precision::Absent),
13021302
sum_value: Precision::Absent,
13031303
distinct_count: Precision::Exact(cs.distinct_count as usize),

‎native-engine/datafusion-ext-commons/src/arrow/cast.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ fn try_cast_string_array_to_integer(array: &dyn Array, cast_type: &DataType) ->
354354
macro_rules! cast {
355355
($target_type:ident) => {{
356356
type B = paste::paste! {[<$target_type Builder>]};
357-
let string_array = as_string_array(array);
357+
let string_array = array
358+
.as_any()
359+
.downcast_ref::<StringArray>()
360+
.expect("Expected a StringArray");
358361
let mut builder = B::new();
359362

360363
for v in string_array.iter() {

‎native-engine/datafusion-ext-commons/src/io/scalar_serde.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn write_scalar<W: Write>(value: &ScalarValue, nullable: bool, output: &mut
4242
write_u8(0, output)?;
4343
}
4444
} else {
45-
output.write_all(&$v.expect("ok").to_ne_bytes())?;
45+
output.write_all(&$v.expect("non-null value required").to_ne_bytes())?;
4646
}
4747
}};
4848
}

‎native-engine/datafusion-ext-plans/src/joins/test.rs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ mod tests {
9191
}
9292

9393
fn build_table_from_batches(batches: Vec<RecordBatch>) -> Arc<dyn ExecutionPlan> {
94-
let schema = batches.first().expect("first").schema();
95-
Arc::new(TestMemoryExec::try_new(&[batches], schema, None).expect("memory_exec"))
94+
let schema = batches.first().expect("missing first batch").schema();
95+
Arc::new(
96+
TestMemoryExec::try_new(&[batches], schema, None)
97+
.expect("failed to create memory exec"),
98+
)
9699
}
97100

98101
fn build_date_table(
@@ -618,12 +621,12 @@ mod tests {
618621
("a1", &vec![Some(1), Some(2), None, Some(4), Some(5)]),
619622
("b1", &vec![Some(4), Some(5), Some(6), None, Some(8)]),
620623
("c1", &vec![Some(7), Some(8), Some(9), Some(10), Some(11)]),
621-
);
624+
)?;
622625
let right = build_table_i32_nullable(
623626
("a2", &vec![Some(10), Some(20), Some(30)]),
624627
("b1", &vec![Some(4), Some(5), Some(7)]),
625628
("c2", &vec![Some(70), Some(80), Some(90)]),
626-
);
629+
)?;
627630
let on: JoinOn = vec![(
628631
Arc::new(Column::new_with_schema("b1", &left.schema())?),
629632
Arc::new(Column::new_with_schema("b1", &right.schema())?),

0 commit comments

Comments
 (0)