mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Merge branch 'master' into fixes-2009
This commit is contained in:
commit
bc0098ccbe
1 changed files with 8 additions and 0 deletions
|
|
@ -439,8 +439,13 @@ func encodeQueryResponse(m *pilosa.QueryResponse) *internal.QueryResponse {
|
|||
case pilosa.RowIdentifiers:
|
||||
pb.Results[i].Type = queryResultTypeRowIdentifiers
|
||||
pb.Results[i].RowIdentifiers = encodeRowIdentifiers(result)
|
||||
case pilosa.Pair:
|
||||
pb.Results[i].Type = queryResultTypePair
|
||||
pb.Results[i].Pairs = []*internal.Pair{encodePair(result)}
|
||||
case nil:
|
||||
pb.Results[i].Type = queryResultTypeNil
|
||||
default:
|
||||
panic(fmt.Errorf("unknown type: %d", pb.Results[i].Type))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1058,6 +1063,7 @@ const (
|
|||
queryResultTypeRowIDs
|
||||
queryResultTypeGroupCounts
|
||||
queryResultTypeRowIdentifiers
|
||||
queryResultTypePair
|
||||
)
|
||||
|
||||
func decodeQueryResult(pb *internal.QueryResult) interface{} {
|
||||
|
|
@ -1080,6 +1086,8 @@ func decodeQueryResult(pb *internal.QueryResult) interface{} {
|
|||
return decodeRowIdentifiers(pb.RowIdentifiers)
|
||||
case queryResultTypeGroupCounts:
|
||||
return decodeGroupCounts(pb.GroupCounts)
|
||||
case queryResultTypePair:
|
||||
return decodePair(pb.Pairs[0])
|
||||
}
|
||||
panic(fmt.Sprintf("unknown type: %d", pb.Type))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue