func DecodeRow(b []byte) (map[int64][]byte, error) {
	row := make(map[int64][]byte)
	if len(b) == 0 {
		return row, nil
	}
	if len(b) == 1 && b[0] == 0 {
		return row, nil
	}
	for len(b) > 0 {
		remain, rowID, err := decodeInt64(b)
		if err != nil {
			return row, err
		}
		var v []byte
		remain, v, err = decodeBytes(remain)
		if err != nil {
			return row, err
		}
		row[rowID] = v
		b = remain
	}
	return row, nil
}
DecodeRow decodes a byte slice into columns.
Row layout: colID1, value1, colID2, value2, .....
It is a simplified and specialized version of `github.com/pingcap/tidb/tablecodec.DecodeRow`.
package util
import (
	"encoding/binary"
	"github.com/pingcap/errors"
)
func EncodeRow(cols [][]byte, colIDs []int64, valBuf []byte) ([]byte, error) {
	if len(cols) != len(colIDs) {
		return nil, errors.Errorf("EncodeRow error: cols and colIDs count not match %d vs %d", len(cols), len(colIDs))
	}
	valBuf = valBuf[:0]
	if len(cols) == 0 {
		return append(valBuf, 0), nil
	}
	for i := range cols {
		valBuf = encodeInt64(valBuf, colIDs[i])
		valBuf = encodeBytes(valBuf, cols[i])
	}
	return valBuf, nil
}
const (
	compactBytesFlag byte = 2
	varintFlag       byte = 8
)
func encodeInt64(b []byte, v int64) []byte {
	b = append(b, varintFlag)
	return appendVarint(b, v)
}
func encodeBytes(b []byte, v []byte) []byte {
	b = append(b, compactBytesFlag)
	b = appendVarint(b, int64(len(v)))
	return append(b, v...)
}
func appendVarint(b []byte, v int64) []byte {
	var data [binary.MaxVarintLen64]byte
	n := binary.PutVarint(data[:], v)
	return append(b, data[:n]...)
}