VECTOR_SUM
functionsupportedAI & MLComputes the element-wise sum of vectors in an aggregate. Returns a vector where each element is the sum of the corresponding elements across all input vectors.
Syntax
VECTOR_SUM( <vector_column> )
Parameters
| Name | Required | Description |
|---|---|---|
vector_column | required | A column containing VECTOR values. All vectors in the column must have the same element type and dimension. |
Returns
Returns a VECTOR value with the same element type and dimension as the input vectors. Each element in the result vector is the sum of the corresponding elements across all input vectors.
Usage notes
- NULL values are ignored in the aggregation.
- If all values in the group are NULL, the function returns NULL.
- All input vectors in the column must have the same dimension and element type.
- Vector functions are optimized in a way that can reduce floating point precision. This function’s results have a margin of error up to 1e-4.