func EvalColDefaultExpr(ctx sessionctx.Context, col *model.ColumnInfo, defaultExpr ast.ExprNode) (types.Datum, error) {
	d, err := expression.EvalAstExpr(ctx, defaultExpr)
	if err != nil {
		return types.Datum{}, err
	}
	value, err := CastValue(ctx, d, col, false, false)
	if err != nil {
		return types.Datum{}, err
	}
	return value, nil
}
EvalColDefaultExpr eval default expr node to explicit default value.
package tables
import (
	"fmt"
	"github.com/pingcap/parser"
	"github.com/pingcap/parser/ast"
	"github.com/pingcap/parser/charset"
	"github.com/pingcap/parser/model"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/tidb/kv"
	"github.com/pingcap/tidb/sessionctx"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/types/json"
	"github.com/pingcap/tidb/util/timeutil"
	tspb "github.com/zhihu/zetta-proto/pkg/tablestore"
	"github.com/zhihu/zetta/tablestore/mysql/expression"
	"strings"
	"time"
)
type columnEntry struct {
	id        int64
	name      string
	t         *tspb.Type
	ft        *types.FieldType
	cfID      int64
	cf        string
	idx       int
	IsPrimary bool
}
func (c columnEntry) ColumnName() string {
	if c.cf != DefaultColumnFamily {
		return c.cf + ":" + c.name
	}
	return c.name
}
type colSparseEntry struct {
	id     int64
	key    kv.Key
	val    []byte
	column string
	cf     string
	cfID   int64
	data   types.Datum
}
type Field struct {
	Family string
	Name   string
	Type   *tspb.Type
	Value  *tspb.Value
}
func CastValue(ctx sessionctx.Context, val types.Datum, col *model.ColumnInfo, returnOverflow, forceIgnoreTruncate bool) (casted types.Datum, err error) {
	sc := ctx.GetSessionVars().StmtCtx
	casted, err = val.ConvertTo(sc, &col.FieldType)
	return casted, err
}
func GetColDefaultValue(ctx sessionctx.Context, col *model.ColumnInfo) (types.Datum, error) {
	defaultValue := col.GetDefaultValue()
	if !col.DefaultIsExpr {
		return getColDefaultValue(ctx, col, defaultValue)
	}
	return getColDefaultExprValue(ctx, col, defaultValue.(string))
}