Skip to content

Commit

Permalink
fix: profile sentence missing data (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao92 authored Jun 2, 2021
1 parent e3ac49e commit 7998b1c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions service/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ func Execute(nsid string, gql string) (result ExecuteResult, err error) {
resp := response.Result
if resp.IsSetPlanDesc() {
format := string(resp.GetPlanDesc().GetFormat())
var rowValue = make(map[string]common.Any)
if format == "row" {
result.Headers = []string{"id", "name", "dependencies", "profiling data", "operator info"}
rows := resp.MakePlanByRow()
for i := 0; i < len(rows); i++ {
var rowValue = make(map[string]common.Any)
rowValue["id"] = rows[i][0]
rowValue["name"] = rows[i][1]
rowValue["dependencies"] = rows[i][2]
Expand All @@ -322,14 +322,14 @@ func Execute(nsid string, gql string) (result ExecuteResult, err error) {
result.Tables = append(result.Tables, rowValue)
}
return result, err
} else if format == "dot" {
result.Headers = append(result.Headers, "format")
rowValue["format"] = resp.MakeDotGraph()
result.Tables = append(result.Tables, rowValue)
return result, err
} else if format == "dot:struct" {
} else {
var rowValue = make(map[string]common.Any)
result.Headers = append(result.Headers, "format")
rowValue["format"] = resp.MakeDotGraphByStruct()
if format == "dot" {
rowValue["format"] = resp.MakeDotGraph()
} else if format == "dot:struct" {
rowValue["format"] = resp.MakeDotGraphByStruct()
}
result.Tables = append(result.Tables, rowValue)
return result, err
}
Expand Down

0 comments on commit 7998b1c

Please sign in to comment.