cockroach: Index | Files

package colencoding

import ""


Package Files

key_encoding.go value_encoding.go

func DecodeIndexKeyToCols Uses

func DecodeIndexKeyToCols(
    da *sqlbase.DatumAlloc,
    vecs []coldata.Vec,
    idx int,
    desc *sqlbase.ImmutableTableDescriptor,
    index *sqlbase.IndexDescriptor,
    indexColIdx []int,
    types []*types.T,
    colDirs []sqlbase.IndexDescriptor_Direction,
    key roachpb.Key,
) (remainingKey roachpb.Key, matches bool, foundNull bool, _ error)

DecodeIndexKeyToCols decodes an index key into the idx'th position of the provided slices of colexec.Vecs. The input index key must already have its tenant id and first table id / index id prefix removed. If matches is false, the key is from a different table, and the returned remainingKey indicates a "seek prefix": the next key that might be part of the table being searched for. The input key will also be mutated if matches is false. See the analog in sqlbase/index_encoding.go.

func DecodeKeyValsToCols Uses

func DecodeKeyValsToCols(
    da *sqlbase.DatumAlloc,
    vecs []coldata.Vec,
    idx int,
    indexColIdx []int,
    types []*types.T,
    directions []sqlbase.IndexDescriptor_Direction,
    unseen *util.FastIntSet,
    key []byte,
) ([]byte, bool, error)

DecodeKeyValsToCols decodes the values that are part of the key, writing the result to the idx'th slot of the input slice of colexec.Vecs. If the directions slice is nil, the direction used will default to encoding.Ascending. If the unseen int set is non-nil, upon decoding the column with ordinal i, i will be removed from the set to facilitate tracking whether or not columns have been observed during decoding. See the analog in sqlbase/index_encoding.go. DecodeKeyValsToCols additionally returns whether a NULL was encountered when decoding.

func DecodeTableValueToCol Uses

func DecodeTableValueToCol(
    da *sqlbase.DatumAlloc,
    vec coldata.Vec,
    idx int,
    typ encoding.Type,
    dataOffset int,
    valTyp *types.T,
    b []byte,
) ([]byte, error)

DecodeTableValueToCol decodes a value encoded by EncodeTableValue, writing the result to the idx'th position of the input exec.Vec. See the analog in sqlbase/column_type_encoding.go.

func UnmarshalColumnValueToCol Uses

func UnmarshalColumnValueToCol(
    da *sqlbase.DatumAlloc, vec coldata.Vec, idx int, typ *types.T, value roachpb.Value,
) error

UnmarshalColumnValueToCol decodes the value from a roachpb.Value using the type expected by the column, writing into the input Vec at the given row idx. An error is returned if the value's type does not match the column's type. See the analog, UnmarshalColumnValue, in sqlbase/column_type_encoding.go

Package colencoding imports 13 packages (graph) and is imported by 2 packages. Updated 2020-08-05. Refresh now. Tools for package owners.