code: func (d *ddl) Stats(vars *variable.SessionVars) (map[string]interface{}, error) {
  	m := make(map[string]interface{})
  	m[serverID] = d.uuid
  	var ddlInfo *admin.DDLInfo
  
  	err := kv.RunInNewTxn(d.store, false, func(txn kv.Transaction) error {
  		var err1 error
  		ddlInfo, err1 = admin.GetDDLInfo(txn)
  		if err1 != nil {
  			return errors.Trace(err1)
  		}
  		return errors.Trace(err1)
  	})
  	if err != nil {
  		return nil, errors.Trace(err)
  	}
  
  	m[ddlSchemaVersion] = ddlInfo.SchemaVer
  	// TODO: Get the owner information.
  	if len(ddlInfo.Jobs) == 0 {
  		return m, nil
  	}
  	// TODO: Add all job information if needed.
  	job := ddlInfo.Jobs[0]
  	m[ddlJobID] = job.ID
  	m[ddlJobAction] = job.Type.String()
  	m[ddlJobStartTS] = job.StartTS / 1e9 // unit: second
  	m[ddlJobState] = job.State.String()
  	m[ddlJobRows] = job.RowCount
  	if job.Error == nil {
  		m[ddlJobError] = ""
  	} else {
  		m[ddlJobError] = job.Error.Error()
  	}
  	m[ddlJobSchemaState] = job.SchemaState.String()
  	m[ddlJobSchemaID] = job.SchemaID
  	m[ddlJobTableID] = job.TableID
  	m[ddlJobSnapshotVer] = job.SnapshotVer
  	m[ddlJobReorgHandle] = ddlInfo.ReorgHandle
  	m[ddlJobArgs] = job.Args
  	return m, nil
  }
docs: // Stats returns the DDL statistics.