Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix execute full gc bugs #96

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions ccore/nebula/gateway/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,21 +355,24 @@ func Execute(nsid string, gql string, paramList types.ParameterList) (ExecuteRes
return result, nil, errors.New(res.GetErrorMsg())
}
if !res.IsEmpty() {
rowSize := res.GetRowSize()
records, err := res.GetRecords()
if err != nil {
return result, nil, err
}

rowSize := len(records)
colSize := res.GetColSize()
colNames := res.GetColNames()
result.Headers = colNames

for i := 0; i < rowSize; i++ {
var rowValue = make(map[string]types.Any)
record, err := res.GetRowValuesByIndex(i)
var _verticesParsedList = make(list, 0)
var _edgesParsedList = make(list, 0)
var _pathsParsedList = make(list, 0)
if err != nil {
return result, nil, err
}

for j := 0; j < colSize; j++ {
rowData, err := record.GetValueByIndex(j)
rowData, err := records[i].GetValueByIndex(j)
if err != nil {
return result, nil, err
}
Expand Down
20 changes: 20 additions & 0 deletions ccore/nebula/wrapper/result_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,26 @@ func (res ResultSet) GetRowValuesByIndex(index int) (*Record, error) {
}, nil
}

func (res ResultSet) GetRecords() ([]*Record, error) {
rows := res.resp.GetData().GetRows()
records := make([]*Record, len(rows))
for i, row := range rows {
valWrap, err := GenValWraps(row, res.factory, res.timezoneInfo)
if err != nil {
return nil, err
}
records[i] = &Record{
columnNames: &res.columnNames,
_record: valWrap,
colNameIndexMap: &res.colNameIndexMap,
factory: res.factory,
timezoneInfo: res.timezoneInfo,
}
}

return records, nil
}

// Returns the number of total rows
func (res ResultSet) GetRowSize() int {
if res.resp.GetData() == nil {
Expand Down