code: func TableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo) (table.Table, error) {
  	if tblInfo.State == model.StateNone {
  		return nil, table.ErrTableStateCantNone.GenWithStack("table %s can't be in none state", tblInfo.Name)
  	}
  
  	colsLen := len(tblInfo.Columns)
  	columns := make([]*table.Column, 0, colsLen)
  	for i, colInfo := range tblInfo.Columns {
  		if colInfo.State == model.StateNone {
  			return nil, table.ErrColumnStateCantNone.GenWithStack("column %s can't be in none state", colInfo.Name)
  		}
  
  		// Print some information when the column's offset isn't equal to i.
  		if colInfo.Offset != i {
  			logutil.Logger(context.Background()).Error("wrong table schema", zap.Any("table", tblInfo), zap.Any("column", colInfo), zap.Int("index", i), zap.Int("offset", colInfo.Offset), zap.Int("columnNumber", colsLen))
  		}
  
  		col := table.ToColumn(colInfo)
  		if col.IsGenerated() {
  			expr, err := parseExpression(colInfo.GeneratedExprString)
  			if err != nil {
  				return nil, err
  			}
  			expr, err = simpleResolveName(expr, tblInfo)
  			if err != nil {
  				return nil, err
  			}
  			col.GeneratedExpr = expr
  		}
  		columns = append(columns, col)
  	}
  
  	var t Table
  	initTableCommon(&t.tableCommon, tblInfo, tblInfo.ID, columns, alloc)
  	if tblInfo.GetPartitionInfo() == nil {
  		if err := initTableIndices(&t.tableCommon); err != nil {
  			return nil, err
  		}
  		return &t, nil
  	}
  
  	return newPartitionedTable(&t, tblInfo)
  }
docs: // TableFromMeta creates a Table instance from model.TableInfo.