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 ¶
RemoveUnusedVirtualCols removes all virtual columns in decodeColMap that cannot found in indexedCols.
func SubstituteGenColsInDecodeColMap ¶
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.