cockroach: github.com/cockroachdb/cockroach/pkg/sql/covering Index | Files

package covering

import "github.com/cockroachdb/cockroach/pkg/sql/covering"

Index

Package Files

overlap_merge.go

type Covering Uses

type Covering []Range

Covering represents a non-overlapping, but possibly non-contiguous, set of intervals.

type Range Uses

type Range struct {
    Start   []byte
    End     []byte
    Payload interface{}
}

Range is an interval with a payload.

func OverlapCoveringMerge Uses

func OverlapCoveringMerge(coverings []Covering) []Range

OverlapCoveringMerge returns the set of intervals covering every range in the input such that no output range crosses an input endpoint. The payloads are returned as a `[]interface{}` and in the same order as they are in coverings.

Example:

covering 1: [1, 2) -> 'a', [3, 4) -> 'b', [6, 7) -> 'c'
covering 2: [1, 5) -> 'd'
output: [1, 2) -> 'ad', [2, 3) -> `d`, [3, 4) -> 'bd', [4, 5) -> 'd', [6, 7) -> 'c'

The input is mutated (sorted). It is also assumed (and not checked) to be valid (e.g. non-overlapping intervals in each covering).

Package covering imports 3 packages (graph) and is imported by 13 packages. Updated 2020-04-13. Refresh now. Tools for package owners.