Skip to content

Commit e5ccc0c

Browse files
committed
x
1 parent 1d08370 commit e5ccc0c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/query/expression/src/stat_evaluator.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ impl<'a> StatEvaluator<'a> {
121121
});
122122

123123
match res {
124+
Ok(None) => Ok(None),
125+
Ok(Some(res)) => {
126+
if cfg!(debug_assertions) {
127+
let return_type = call.return_type.remove_generics(&call.generics);
128+
res.check_consistency_with_type(Some(&return_type))
129+
.map_err(|msg| {
130+
ErrorCode::Internal(format!(
131+
"Failed to derive statistics for function {:?}: {msg}",
132+
call.function.signature.name
133+
))
134+
})?;
135+
}
136+
Ok(Some(res))
137+
}
124138
Err(msg) => {
125139
if cfg!(debug_assertions) {
126140
Err(ErrorCode::Internal(format!(
@@ -132,7 +146,6 @@ impl<'a> StatEvaluator<'a> {
132146
Ok(None)
133147
}
134148
}
135-
Ok(res) => Ok(res),
136149
}
137150
}
138151
}

0 commit comments

Comments
 (0)