Table function
Use non-NULL literal endpoints. The generated id values are not NULL.
Syntax
Table
Start end (table)
Step (table)
- INLINE_TABLE_FUNCTIONS=true
With numParts (table)
- INLINE_TABLE_FUNCTIONS=true
Arguments
Table
Start end
Step
With numParts
Returns
- Type: TABLE<id:BIGINT>
- NULL behavior: Use non-NULL literal endpoints. The generated id values are not NULL.
- Empty input: A range whose step points away from its endpoint emits no rows.
- Shape: A table with one BIGINT column named id; end is excluded.
- Ordering: Values follow the requested step logically; use ORDER BY id for guaranteed SQL result order.
Properties
Usage notes
- RANGE(end) starts at 0; RANGE(start,end) uses a default step of 1.
- The three- and four-argument RANGE forms require INLINE_TABLE_FUNCTIONS=true. When this setting is false, only the one- and two-argument forms with literal values are supported.
- Bounds must be literals. numParts is accepted but has no effect on how the generated rows are divided for processing.
- Deterministic: The same inputs and settings produce the same result.
Examples
Typical behavior
Choose a start, stop and step
The stop value is excluded.
Limitations
- step cannot be zero.
- Use literal arguments; huge ranges can consume substantial planning memory, and fixed-width endpoint arithmetic has finite bounds.
Last modified on October 15, 2026