DOT_PRODUCT

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Computes the conventional dot product (scalar product) of two vectors.

  • <array1>: The first vector (array(real) or array(double precision)).
  • <array2>: The second vector (array(real) or array(double precision)).

Returns a double-precision value that represents the dot product of the two vectors.

  • Both input arrays must be of the same element type and length.
  • If any element is NULL, the result is NULL.
  • For optimal performance, use array definitions with non-nullable elements such as array(real not null).

Compute the dot product of two vectors.

Returns -6.0, calculated as (1 × -1) + (2 ×2 ) + (3 × -3) = -1 + 4 - 9 = -6.