Documentation ¶
Index ¶
- func BuildFullDecodeColMap(cols []*table.Column, schema *expression.Schema) map[int64]Column
- type Column
- type RowDecoder
- func (rd *RowDecoder) CurrentRowWithDefaultVal() chunk.Row
- func (rd *RowDecoder) DecodeAndEvalRowWithMap(ctx exprctx.BuildContext, handle kv.Handle, b []byte, decodeLoc *time.Location, ...) (map[int64]types.Datum, error)
- func (rd *RowDecoder) DecodeTheExistedColumnMap(ctx exprctx.BuildContext, handle kv.Handle, b []byte, decodeLoc *time.Location, ...) (map[int64]types.Datum, error)
- func (rd *RowDecoder) EvalRemainedExprColumnMap(ctx exprctx.BuildContext, row map[int64]types.Datum) (map[int64]types.Datum, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFullDecodeColMap ¶
BuildFullDecodeColMap builds a map that contains [columnID -> struct{*table.Column, expression.Expression}] from all columns.
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, cols []*table.Column, decodeColMap map[int64]Column) *RowDecoder
NewRowDecoder returns a new RowDecoder.
func (*RowDecoder) CurrentRowWithDefaultVal ¶
func (rd *RowDecoder) CurrentRowWithDefaultVal() chunk.Row
CurrentRowWithDefaultVal returns current decoding row with default column values set properly. Please make sure calling DecodeAndEvalRowWithMap first.
func (*RowDecoder) DecodeAndEvalRowWithMap ¶
func (rd *RowDecoder) DecodeAndEvalRowWithMap(ctx exprctx.BuildContext, handle kv.Handle, b []byte, decodeLoc *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.
func (*RowDecoder) DecodeTheExistedColumnMap ¶
func (rd *RowDecoder) DecodeTheExistedColumnMap(ctx exprctx.BuildContext, handle kv.Handle, b []byte, decodeLoc *time.Location, row map[int64]types.Datum) (map[int64]types.Datum, error)
DecodeTheExistedColumnMap is used by ddl column-type-change first column reorg stage. In the function, we only decode the existed column in the row and fill the default value. For changing column, we shouldn't cast it here, because we will do a unified cast operation latter. For generated column, we didn't cast it here too, because the eval process will depend on the changing column.
func (*RowDecoder) EvalRemainedExprColumnMap ¶
func (rd *RowDecoder) EvalRemainedExprColumnMap(ctx exprctx.BuildContext, row map[int64]types.Datum) (map[int64]types.Datum, error)
EvalRemainedExprColumnMap is used by ddl column-type-change first column reorg stage. It is always called after DecodeTheExistedColumnMap to finish the generated column evaluation.