GRADUAL_ROLLOUT()
All functions > BUSINESS > GRADUAL_ROLLOUT()
Returns the exposure to a new version based on the given hashing key and rollout parameters.
Signatures
Returns: TRUE if user should see new version at given time
GRADUAL_ROLLOUT(hashing_key: VARCHAR, time_ref: TIMESTAMP, time_0pc: TIMESTAMP, time_100pc: TIMESTAMP, [power: DOUBLE], [chunks: BIGINT]) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
hashing_key | VARCHAR | Yes | String value to hash (typically user ID or session ID) |
time_ref | TIMESTAMP | Yes | Reference timestamp to evaluate rollout at |
time_0pc | TIMESTAMP | Yes | Start time of rollout (0% exposure) |
time_100pc | TIMESTAMP | Yes | End time of rollout (100% exposure) |
power | DOUBLE | No | Optional power curve exponent (default 1.0 = linear) |
chunks | BIGINT | No | Optional number of discrete rollout chunks (default 10) |
Notes
- Deterministic - same key and time always produce same result
- Gradually increases exposure from 0% to 100% over time period
- Before time_0pc: 0% exposure (Returns FALSE)
- After time_100pc: 100% exposure (Returns TRUE)
- Between times: gradual rollout based on user hash
- Power parameter controls rollout curve (>1 = slow start, <1 = fast start)
- Chunks parameter creates discrete rollout steps
- Useful for controlled feature releases, phased migrations
Examples
FeatureQL
SELECT
f1 := GRADUAL_ROLLOUT('salt', TIMESTAMP '2025-04-20 14:00:00', TIMESTAMP '2025-04-20 10:00:00', TIMESTAMP '2025-04-20 18:00:00', 1E0, 8) -- Mid-rollout hour with linear curve and eight chunks (example key not yet exposed)
;Result
| f1 BOOLEAN |
|---|
| false |
On this page