Skip to content

Commit

Permalink
fix execute full gc (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
kqzh authored Mar 29, 2022
1 parent 2860ba8 commit f599adf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
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

0 comments on commit f599adf

Please sign in to comment.