Skip to content

Commit d1b7080

Browse files
committed
feat: add additional vector restrictions for validation
Signed-off-by: Alan Tang <[email protected]>
1 parent 02ba91d commit d1b7080

File tree

1 file changed

+5
-0
lines changed
  • src/common/function/src/aggrs/vector

1 file changed

+5
-0
lines changed

src/common/function/src/aggrs/vector/avg.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ impl VectorAvg {
131131
let dims = vectors[0].len();
132132
let mut sum = DVector::zeros(dims);
133133
for v in vectors {
134+
if v.len() != dims {
135+
return Err(datafusion_common::DataFusionError::Execution(
136+
"vectors length not match: VEC_AVG".to_string(),
137+
));
138+
}
134139
let v_view = DVectorView::from_slice(&v, dims);
135140
sum += &v_view;
136141
}

0 commit comments

Comments
 (0)