Closed BohuTANG closed 2 years ago
@sundy-li , is it a way to escape the error from the closure? https://github.com/datafuselabs/databend/blob/d4baa9c928284e8c491488519bd24d610421fc83/common/datablocks/src/kernels/data_block_group_by_hash.rs#L321-L325
Found some .numeric_byte_size().unwrap()
in data_block_group_by_hash.rs, seems all of them is in a closure.
Yes, unwrap
is too dangerous here.
This works:
let mut null_offsize = group_fields
.iter()
.map(|c| {
let ty = c.data_type();
remove_nullable(ty).data_type_id().numeric_byte_size()
})
.sum::<Result<usize>>()?;
Search before asking
Version
main
What's Wrong?
How to Reproduce?
Create table:
Insert into datas:
Select:
If the server panic, client can get the correct ERROR info here:
Are you willing to submit PR?