name: op-group-range
description: Partition numeric records into half-open ranges [a, b); `interval` sets the bucket width.
kind: operator
category: GROUP
operator: GROUP_RANGE
type: reference
applies_to: process, compose, predict
examples_tags: [cohort-analysis, streaming-friendly]
Use when
Splits a number into bands of equal width, such as ages 20-30 and 30-40, to see how values spread or to compare bands.
Questions it answers:
- How many customers fall in each 10-year age band?
- What does the spread of delivery times look like in 1-hour bands?
Use something else:
GROUP_QUANTILEwhen you want groups of equal size rather than equal width.GROUP_ROUNDEDwhen you want each band named by its lower edge alone.
Params
| Name | Type | Default | Description |
|---|---|---|---|
interval | float | 1 | Bucket width; the slot’s top-level interval, not params. ≤ 0 is treated as 1. |
Inputs
field — admitted types: see ## Contract; decimal128 reads as its float64 echo, packed_bool as 0/1.
Output
String label "low-high" per row ("10-20" holds [10, 20)). Rows emit by numeric low edge ("-20--10", "-10-0", "0-10", "10-20", "100-110") on every arm (streaming, shards, fused crosstab). An explicit sort or crosstab-axis include wins; sorting the key column compares strings.
Components
interval— Bucket widthrange_min— Smallest non-nullrange_max— Largest non-nulln_buckets— Buckets emittededges— Sorted cutpointsbuckets—{key, low, high, count}underflow_count— Below lowoverflow_count— At/above high- Fans out whatever the bucket count; at very high cardinality (buckets ≳ 70% of each partition’s rows) the fan-out gains nothing, which predict cannot see.
- Eligible for the fused crosstab.
Contract
- Types (
field):date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: not read; a weight in force is skipped.
- Streaming: streamable; components
mergeable. - Components:
total_n,n_null,interval,range_min,range_max,n_buckets,edges,buckets,underflow_count,overflow_count.
Gotchas
- Half-open
[low, high)— upper edge belongs to next bucket. - Explicit
"type":"GROUP_RANGE"withoutintervalbuckets at width 1; a numeric slot with notypegets the smart default GROUP_RANGE withinterval10 (defaults_applied). includeongroupsis refused (PROCESSING_CONFIG); a crosstab axis keeps it for order.
See
pulse_examples_search tags=[cohort-analysis]- Skills:
grouper-design,op-group-rounded