VECTOR functions

更新时间:
复制 MD 格式

MaxCompute SQL provides VECTOR functions to operate on the VECTOR data type. These functions support various distance and retrieval operations for use cases such as semantic search, enhancing Large Language Models (LLMs), and generative AI.

Function

Description

COSINE_DISTANCE

Calculates the cosine distance between two vectors.

INNER_PRODUCT_DISTANCE

Calculates the inner product distance between two vectors.

L2_DISTANCE

Calculates the L2 Euclidean distance between two vectors.

VECTOR_SEARCH

Performs vector similarity search and supports large-scale approximate nearest neighbor (ANN) search.