HASH01

All functions > BUSINESS > HASH01

Returns a value between 0 and 1 based on the given hashing key.

Signatures

Returns: Deterministic value in range [0.0, 1.0)

HASH01(hashing_key: VARCHAR) → DOUBLE
sql
ParameterTypeRequiredDescription
hashing_keyVARCHARYesString value to hash (typically user ID or session ID)

Notes

  • Deterministic hash - same key always produces same value
  • Uses MD5 hashing internally
  • Uniformly distributed across [0.0, 1.0) range
  • Useful for A/B testing, sampling, and rollouts
  • Each unique key maps to a stable value
  • Foundation for other simulation functions (SAMPLE_UNIFORM, SAMPLE_BOOL)
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19