`HAMMING_SIMILARITY`
Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API
markdownreferencev16K1S-03HHguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`HAMMING_SIMILARITY`Data 360Data CloudData 360 Query Guide
Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/hamming-similarity.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.
HAMMING_SIMILARITY
Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API
Calculates the similarity between two quantized (binary) embeddings using the normalized Hamming distance.
<bytea1>: The first binary-quantized vector.<bytea2>: The second binary-quantized vector.
Returns a double-precision value between 0 and 1, where 1 indicates identical binary vectors.
- Both inputs must be bytea values of the same length.
- This function provides fast, approximate similarity. Use exact methods when precision is critical.
Compare two binary-quantized vectors.
Returns 0.75, indicating 3 out of 4 bits match between the two vectors.
Cookie Consent Manager
Cookie Consent Manager
- ### General Information
- ### Required Cookies
- ### Functional Cookies
- ### Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings. Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Cookies Details
Functional Cookies
- [x] Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Cookies Details
Advertising Cookies
- [x] Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.
Cookies Details
Cookie List
Consent Leg.Interest
- [x] checkbox label label
- [x] checkbox label label
- [x] checkbox label label
Clear
- - [x] checkbox label label
Apply Cancel
Save Settings
Accept All Cookies
