snowflake.snowpark.functions.vector_inner_product

snowflake.snowpark.functions.vector_inner_product(v1: Union[Column, str], v2: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L5812-L5828)

Returns the inner product between two vectors of equal dimension and element type.

Example::
>>> from snowflake.snowpark.functions import vector_inner_product
>>> df = session.sql("select [1,2,3]::vector(int,3) as a, [2,3,4]::vector(int,3) as b")
>>> df.select(vector_inner_product(df.a, df.b).as_("dist")).show()
----------
|"DIST"  |
----------
|20.0    |
----------
Copy
语言: 中文