decoder

package
v3.1.0-fork Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFullDecodeColMap

func BuildFullDecodeColMap(indexedCols []*table.Column, t table.Table, genExprProducer func(*table.Column) (expression.Expression, error)) (map[int64]Column, error)

BuildFullDecodeColMap build a map that contains [columnID -> struct{*table.Column, expression.Expression}] from indexed columns and all of its depending columns. `genExprProducer` is used to produce a generated expression based on a table.Column.

func RemoveUnusedVirtualCols

func RemoveUnusedVirtualCols(decodeColMap map[int64]Column, indexedCols []*table.Column)

RemoveUnusedVirtualCols removes all virtual columns in decodeColMap that cannot found in indexedCols.

func SubstituteGenColsInDecodeColMap

func SubstituteGenColsInDecodeColMap(decodeColMap map[int64]Column)

SubstituteGenColsInDecodeColMap substitutes generated columns in every expression with non-generated one by looking up decodeColMap.

Types

type Column

type Column struct {
	Col     *table.Column
	GenExpr expression.Expression
}

Column contains the info and generated expr of column.

type RowDecoder

type RowDecoder struct {
	// contains filtered or unexported fields
}

RowDecoder decodes a byte slice into datums and eval the generated column value.

func NewRowDecoder

func NewRowDecoder(tbl table.Table, decodeColMap map[int64]Column) *RowDecoder

NewRowDecoder returns a new RowDecoder.

func (*RowDecoder) DecodeAndEvalRowWithMap

func (rd *RowDecoder) DecodeAndEvalRowWithMap(ctx sessionctx.Context, handle int64, b []byte, decodeLoc, sysLoc *time.Location, row map[int64]types.Datum) (map[int64]types.Datum, error)

DecodeAndEvalRowWithMap decodes a byte slice into datums and evaluates the generated column value.

Jump to

Keyboard shortcuts

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