Documentation
¶
Overview ¶
Package rangefn implements the runtime body for GoogleSQL RANGE functions: the constructor `RANGE(start, end)` and the accessors `RANGE_START`, `RANGE_END`, `RANGE_IS_START_UNBOUNDED`, `RANGE_IS_END_UNBOUNDED`.
RANGE is a first-party GoogleSQL type (TYPE_RANGE = 29 in googlesql/public/type.proto, gated by FEATURE_RANGE_TYPE), so the `*value.RangeValue` shape lives in `internal/value` alongside the other primitives.
Index ¶
- func BindGenerateRangeArray(args ...value.Value) (value.Value, error)
- func BindRange(args ...value.Value) (value.Value, error)
- func BindRangeContains(args ...value.Value) (value.Value, error)
- func BindRangeEnd(args ...value.Value) (value.Value, error)
- func BindRangeIntersect(args ...value.Value) (value.Value, error)
- func BindRangeIsEndUnbounded(args ...value.Value) (value.Value, error)
- func BindRangeIsStartUnbounded(args ...value.Value) (value.Value, error)
- func BindRangeOverlaps(args ...value.Value) (value.Value, error)
- func BindRangeSessionize(args ...value.Value) (value.Value, error)
- func BindRangeStart(args ...value.Value) (value.Value, error)
- func RANGE(start, end value.Value) (value.Value, error)
- func RANGE_END(r *value.RangeValue) (value.Value, error)
- func RANGE_IS_END_UNBOUNDED(r *value.RangeValue) (value.Value, error)
- func RANGE_IS_START_UNBOUNDED(r *value.RangeValue) (value.Value, error)
- func RANGE_START(r *value.RangeValue) (value.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindGenerateRangeArray ¶
BindGenerateRangeArray splits a RANGE into an ARRAY<RANGE> by stepping the start bound forward by `step` until reaching the end. step is an INTERVAL value; the implementation honours the common daily / hourly / monthly cases by delegating to the bound's own addition operator.
func BindRangeContains ¶
BindRangeContains implements RANGE_CONTAINS(outer, inner) and the overload RANGE_CONTAINS(range, point). The outer-vs-inner overload returns TRUE when the outer range covers every element of the inner range; the point overload returns TRUE when `point ∈ range`.
func BindRangeIntersect ¶
BindRangeIntersect returns the intersection of two RANGEs, or NULL when the ranges do not overlap.
func BindRangeIsEndUnbounded ¶
func BindRangeOverlaps ¶
BindRangeOverlaps returns TRUE iff the two ranges have any point in common.
func BindRangeSessionize ¶
BindRangeSessionize is the scalar form of the RANGE_SESSIONIZE TVF. At the analyzer level this is rewritten into a windowed scan; the scalar binding exists so that direct UDF resolution succeeds. It returns its first argument unchanged.
func RANGE_END ¶
func RANGE_END(r *value.RangeValue) (value.Value, error)
RANGE_END returns the upper bound of the range (NULL when unbounded).
func RANGE_IS_END_UNBOUNDED ¶
func RANGE_IS_END_UNBOUNDED(r *value.RangeValue) (value.Value, error)
RANGE_IS_END_UNBOUNDED reports whether the range's end is NULL.
func RANGE_IS_START_UNBOUNDED ¶
func RANGE_IS_START_UNBOUNDED(r *value.RangeValue) (value.Value, error)
RANGE_IS_START_UNBOUNDED reports whether the range's start is NULL.
func RANGE_START ¶
func RANGE_START(r *value.RangeValue) (value.Value, error)
RANGE_START returns the lower bound of the range (NULL when unbounded).
Types ¶
This section is empty.