array_inner_product
Computes the inner product between two arrays of the same size. The array elements can not be NULL. The arrays can have any size as long as the size is the same for both arguments.
Also available as array_dot_product.
Try an expression
In Formula, enter the expression and set Output type to FLOAT.
Expression
array_inner_product(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))Result
20.0To use your own data, replace the example values with column names. Keep format strings and other options as written.
Arguments and types
array_inner_product(array1, array2)- array1
- List
- array2
- List
Supported signatures (2)
array_inner_product(array1: DOUBLE[ANY], array2: DOUBLE[ANY]) → DOUBLE
array_inner_product(array1: FLOAT[ANY], array2: FLOAT[ANY]) → FLOATThe result type can depend on the input types. See DuckDB for the full argument rules.
Things to know
If the first argument is missing, the result is NULL.
Function metadata from DuckDB, used under the MIT license.