APPROXIMATE_SIMILARITY

functionsupportedCore SQL functions

docs.snowflake.com ↗

Aggregate functionsWindow function syntax and usage

Returns an estimation of the similarity (Jaccard index) of inputs based on their MinHash states. For more information about MinHash states, see Estimating Similarity of Two or More Sets.

Syntax

supportedpartialnot supportednot scored

APPROXIMATE_SIMILARITY( [ DISTINCT ] <expr> [ , ... ] )

APPROXIMATE_SIMILARITY(*)

Parameters

NameRequiredDescription
exprrequiredThe expression(s) should be one or more MinHash states returned by calls to the MINHASH function. In other words, the expressions must be MinHash state information, not the column or expression for which you want the approximate similarity. (The example below helps make this clear.) For more information about MinHash states, see Estimating Similarity of Two or More Sets.

Returns

A floating point number between 0.0 and 1.0 (inclusive), where 1.0 indicates that the sets are identical, and 0.0 indicates that the sets have no overlap.

Usage notes

See also