Documentation ¶
Index ¶
- Constants
- func FieldTypeFromModelColumn(col *model.ColumnInfo) *types.FieldType
- func IsNewFormat(rowData []byte) bool
- func IsRowKey(key []byte) bool
- func NewDecoder(columns []ColInfo, handleColIDs []int64, loc *time.Location) *decoder
- type BytesDecoder
- type ChunkDecoder
- type ColInfo
- type DatumMapDecoder
- type Encoder
Constants ¶
const ( NilFlag byte = 0 BytesFlag byte = 1 CompactBytesFlag byte = 2 IntFlag byte = 3 UintFlag byte = 4 FloatFlag byte = 5 DecimalFlag byte = 6 VarintFlag byte = 8 VaruintFlag byte = 9 JSONFlag byte = 10 )
First byte in the encoded value which specifies the encoding type.
const CodecVer = 128
CodecVer is the constant number that represent the new row format.
Variables ¶
This section is empty.
Functions ¶
func FieldTypeFromModelColumn ¶
func FieldTypeFromModelColumn(col *model.ColumnInfo) *types.FieldType
FieldTypeFromModelColumn creates a types.FieldType from model.ColumnInfo. export for test case and CDC.
func IsNewFormat ¶
IsNewFormat checks whether row data is in new-format.
Types ¶
type BytesDecoder ¶
type BytesDecoder struct {
// contains filtered or unexported fields
}
BytesDecoder decodes the row to old datums bytes.
func NewByteDecoder ¶
func NewByteDecoder(columns []ColInfo, handleColIDs []int64, defBytes func(i int) ([]byte, error), loc *time.Location) *BytesDecoder
NewByteDecoder creates a BytesDecoder. defBytes: provided default value bytes in old datum format(flag+colData).
func (*BytesDecoder) DecodeToBytes ¶
func (decoder *BytesDecoder) DecodeToBytes(outputOffset map[int64]int, handle kv.Handle, value []byte, cacheBytes []byte) ([][]byte, error)
DecodeToBytes decodes raw byte slice to row data.
func (*BytesDecoder) DecodeToBytesNoHandle ¶
func (decoder *BytesDecoder) DecodeToBytesNoHandle(outputOffset map[int64]int, value []byte) ([][]byte, error)
DecodeToBytesNoHandle decodes raw byte slice to row data without handle.
type ChunkDecoder ¶
type ChunkDecoder struct {
// contains filtered or unexported fields
}
ChunkDecoder decodes the row to chunk.Chunk.
func NewChunkDecoder ¶
func NewChunkDecoder(columns []ColInfo, handleColIDs []int64, defDatum func(i int, chk *chunk.Chunk) error, loc *time.Location) *ChunkDecoder
NewChunkDecoder creates a NewChunkDecoder.
func (*ChunkDecoder) DecodeToChunk ¶
func (decoder *ChunkDecoder) DecodeToChunk(rowData []byte, handle kv.Handle, chk *chunk.Chunk) error
DecodeToChunk decodes a row to chunk.
type DatumMapDecoder ¶
type DatumMapDecoder struct {
// contains filtered or unexported fields
}
DatumMapDecoder decodes the row to datum map.
func NewDatumMapDecoder ¶
func NewDatumMapDecoder(columns []ColInfo, loc *time.Location) *DatumMapDecoder
NewDatumMapDecoder creates a DatumMapDecoder.
type Encoder ¶
type Encoder struct { // Enable indicates whether this encoder should be use. Enable bool // contains filtered or unexported fields }
Encoder is used to encode a row.
func (*Encoder) ColumnIsNull ¶
ColumnIsNull returns if the column value is null. Mainly used for count column aggregation. this method will used in unistore.