MCPcopy Create free account
hub / github.com/pingcap/tidb / DecodeColumnValue

Function DecodeColumnValue

pkg/tablecodec/tablecodec.go:438–448  ·  view source on GitHub ↗

DecodeColumnValue decodes data to a Datum according to the column info.

(data []byte, ft *types.FieldType, loc *time.Location)

Source from the content-addressed store, hash-verified

436
437// DecodeColumnValue decodes data to a Datum according to the column info.
438func DecodeColumnValue(data []byte, ft *types.FieldType, loc *time.Location) (types.Datum, error) {
439 _, d, err := codec.DecodeOne(data)
440 if err != nil {
441 return types.Datum{}, errors.Trace(err)
442 }
443 colDatum, err := Unflatten(d, ft, loc)
444 if err != nil {
445 return types.Datum{}, errors.Trace(err)
446 }
447 return colDatum, nil
448}
449
450// DecodeColumnValueWithDatum decodes data to an existing Datum according to the column info.
451func DecodeColumnValueWithDatum(data []byte, ft *types.FieldType, loc *time.Location, result *types.Datum) error {

Callers 14

decodeIndexKeyMethod · 0.92
DecodeToMethod · 0.92
CollectMethod · 0.92
CollectColumnStatsMethod · 0.92
ExtractTopNMethod · 0.92
GenIndexValueFromIndexFunction · 0.92
checkIndexKeysFunction · 0.92
buildStatsMethod · 0.92
buildSamplingStatsMethod · 0.92
decodeIndexKeyValueMethod · 0.92

Calls 2

DecodeOneFunction · 0.92
UnflattenFunction · 0.85

Tested by 1

TestDecodeColumnValueFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…