rangefn

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2026 License: MIT Imports: 4 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindGenerateRangeArray

func BindGenerateRangeArray(args ...value.Value) (value.Value, error)

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 BindRange

func BindRange(args ...value.Value) (value.Value, error)

func BindRangeContains

func BindRangeContains(args ...value.Value) (value.Value, error)

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 BindRangeEnd

func BindRangeEnd(args ...value.Value) (value.Value, error)

func BindRangeIntersect

func BindRangeIntersect(args ...value.Value) (value.Value, error)

BindRangeIntersect returns the intersection of two RANGEs, or NULL when the ranges do not overlap.

func BindRangeIsEndUnbounded

func BindRangeIsEndUnbounded(args ...value.Value) (value.Value, error)

func BindRangeIsStartUnbounded

func BindRangeIsStartUnbounded(args ...value.Value) (value.Value, error)

func BindRangeOverlaps

func BindRangeOverlaps(args ...value.Value) (value.Value, error)

BindRangeOverlaps returns TRUE iff the two ranges have any point in common.

func BindRangeSessionize

func BindRangeSessionize(args ...value.Value) (value.Value, error)

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 BindRangeStart

func BindRangeStart(args ...value.Value) (value.Value, error)

func RANGE

func RANGE(start, end value.Value) (value.Value, error)

RANGE constructs a RANGE value from start and end bounds.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL