From 5cb37834a0304b17f75ec4aab40048e4acf74d46 Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 10 Dec 2019 16:05:45 -0600 Subject: [PATCH 1/3] Wrap return types: RowIdentifiers, Pair, and []Pair This PR adds a field name (string) to the return types which represent the values from a specific field. For example, a TopN query on field `x` would be `TopN(x)` and have results like: ``` []Pair{ {ID: 14, Count: 10}, {ID: 3, Count: 8}, {ID: 7, Count: 3}, } ``` In order to know what field this result type refers to, we wrap `[]Pair` in a new struct called `PairsField` which contains an addition `Field` string where `x` is stored. This is useful for informing the gRPC server how to construct more appropriate headers for the result stream (in this case, the column headers can now be "x" and "count"). Similar logic was applied to `RowIdentifiers` and `Pair` as well. --- cache.go | 25 + encoding/proto/proto.go | 56 +++ executor.go | 161 ++++--- executor_test.go | 177 ++++--- http/client_test.go | 35 +- internal/private.pb.go | 72 +-- internal/public.pb.go | 862 ++++++++++++++++++++++++++++------- internal/public.proto | 13 +- server/grpc.go | 30 +- server/grpc_internal_test.go | 4 +- server/handler_test.go | 11 +- 11 files changed, 1086 insertions(+), 360 deletions(-) diff --git a/cache.go b/cache.go index 05572fa11..6ff6f954a 100644 --- a/cache.go +++ b/cache.go @@ -16,6 +16,7 @@ package pilosa import ( "bytes" + "encoding/json" "fmt" "io" "sort" @@ -322,6 +323,18 @@ type Pair struct { Count uint64 `json:"count"` } +// PairField +type PairField struct { + Pair Pair + Field string +} + +// MarshalJSON marshals PairField into a JSON-encoded byte slice, +// excluding `Field`. +func (p PairField) MarshalJSON() ([]byte, error) { + return json.Marshal(p.Pair) +} + // Pairs is a sortable slice of Pair objects. type Pairs []Pair @@ -397,6 +410,18 @@ func (p Pairs) String() string { return buf.String() } +// PairsField +type PairsField struct { + Pairs []Pair + Field string +} + +// MarshalJSON marshals PairsField into a JSON-encoded byte slice, +// excluding `Field`. +func (p PairsField) MarshalJSON() ([]byte, error) { + return json.Marshal(p.Pairs) +} + // uint64Slice represents a sortable slice of uint64 numbers. type uint64Slice []uint64 diff --git a/encoding/proto/proto.go b/encoding/proto/proto.go index 322cca1d1..c1644ed58 100644 --- a/encoding/proto/proto.go +++ b/encoding/proto/proto.go @@ -450,6 +450,9 @@ func encodeQueryResponse(m *pilosa.QueryResponse) *internal.QueryResponse { case []pilosa.Pair: pb.Results[i].Type = queryResultTypePairs pb.Results[i].Pairs = encodePairs(result) + case *pilosa.PairsField: + pb.Results[i].Type = queryResultTypePairsField + pb.Results[i].PairsField = encodePairsField(result) case pilosa.ValCount: pb.Results[i].Type = queryResultTypeValCount pb.Results[i].ValCount = encodeValCount(result) @@ -471,6 +474,9 @@ func encodeQueryResponse(m *pilosa.QueryResponse) *internal.QueryResponse { case pilosa.Pair: pb.Results[i].Type = queryResultTypePair pb.Results[i].Pairs = []*internal.Pair{encodePair(result)} + case pilosa.PairField: + pb.Results[i].Type = queryResultTypePairField + pb.Results[i].Pairs = []*internal.Pair{encodePairField(result)} case nil: pb.Results[i].Type = queryResultTypeNil default: @@ -1101,6 +1107,7 @@ const ( queryResultTypeNil uint32 = iota queryResultTypeRow queryResultTypePairs + queryResultTypePairsField queryResultTypeValCount queryResultTypeUint64 queryResultTypeBool @@ -1108,6 +1115,7 @@ const ( queryResultTypeGroupCounts queryResultTypeRowIdentifiers queryResultTypePair + queryResultTypePairField queryResultTypeSignedRow ) @@ -1119,6 +1127,8 @@ func decodeQueryResult(pb *internal.QueryResult) interface{} { return decodeRow(pb.Row) case queryResultTypePairs: return decodePairs(pb.Pairs) + case queryResultTypePairsField: + return decodePairsField(pb.PairsField) case queryResultTypeValCount: return decodeValCount(pb.ValCount) case queryResultTypeUint64: @@ -1135,6 +1145,8 @@ func decodeQueryResult(pb *internal.QueryResult) interface{} { return decodeGroupCounts(pb.GroupCounts) case queryResultTypePair: return decodePair(pb.Pairs[0]) + case queryResultTypePairField: + return decodePairField(pb.Pairs[0]) } panic(fmt.Sprintf("unknown type: %d", pb.Type)) } @@ -1243,6 +1255,17 @@ func decodePairs(a []*internal.Pair) []pilosa.Pair { return other } +func decodePairsField(a *internal.PairsField) *pilosa.PairsField { + other := &pilosa.PairsField{ + Pairs: make([]pilosa.Pair, len(a.Pairs)), + } + for i := range a.Pairs { + other.Pairs[i] = decodePair(a.Pairs[i]) + } + other.Field = a.Field + return other +} + func decodePair(pb *internal.Pair) pilosa.Pair { return pilosa.Pair{ ID: pb.ID, @@ -1251,6 +1274,17 @@ func decodePair(pb *internal.Pair) pilosa.Pair { } } +func decodePairField(pb *internal.Pair) pilosa.PairField { + return pilosa.PairField{ + Pair: pilosa.Pair{ + ID: pb.ID, + Key: pb.Key, + Count: pb.Count, + }, + //Field: pb.Field, // TODO: in order to have this, we need PairField in QueryResponse. + } +} + func decodeValCount(pb *internal.ValCount) pilosa.ValCount { return pilosa.ValCount{ Val: pb.Val, @@ -1346,6 +1380,17 @@ func encodePairs(a pilosa.Pairs) []*internal.Pair { return other } +func encodePairsField(a *pilosa.PairsField) *internal.PairsField { + other := &internal.PairsField{ + Pairs: make([]*internal.Pair, len(a.Pairs)), + } + for i := range a.Pairs { + other.Pairs[i] = encodePair(a.Pairs[i]) + } + other.Field = a.Field + return other +} + func encodePair(p pilosa.Pair) *internal.Pair { return &internal.Pair{ ID: p.ID, @@ -1354,6 +1399,17 @@ func encodePair(p pilosa.Pair) *internal.Pair { } } +func encodePairField(p pilosa.PairField) *internal.Pair { + /* + // TODO: in order to have this, we need PairField in QueryResponse. + return &internal.Pair{ + Pair: encodePair(p.Pair), + Field: p.Field, + } + */ + return encodePair(p.Pair) +} + func encodeValCount(vc pilosa.ValCount) *internal.ValCount { return &internal.ValCount{ Val: vc.Val, diff --git a/executor.go b/executor.go index 9a39d7697..72c6da626 100644 --- a/executor.go +++ b/executor.go @@ -808,14 +808,19 @@ func (e *executor) executeMinRow(ctx context.Context, index string, c *pql.Call, reduceFn := func(prev, v interface{}) interface{} { // if minRowID exists, and if it is smaller than the other one return it. // otherwise return the minRowID of the one which exists. - prevp, _ := prev.(Pair) - vp, _ := v.(Pair) - if prevp.Count > 0 && vp.Count > 0 { - if prevp.ID < vp.ID { + if prev == nil { + return v + } else if v == nil { + return prev + } + prevp, _ := prev.(PairField) + vp, _ := v.(PairField) + if prevp.Pair.Count > 0 && vp.Pair.Count > 0 { + if prevp.Pair.ID < vp.Pair.ID { return prevp } return vp - } else if prevp.Count > 0 { + } else if prevp.Pair.Count > 0 { return prevp } return vp @@ -824,7 +829,7 @@ func (e *executor) executeMinRow(ctx context.Context, index string, c *pql.Call, return e.mapReduce(ctx, index, shards, c, opt, mapFn, reduceFn) } -// executeMinRow executes a MaxRow() call. +// executeMaxRow executes a MaxRow() call. func (e *executor) executeMaxRow(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) (interface{}, error) { span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeMaxRow") defer span.Finish() @@ -842,14 +847,19 @@ func (e *executor) executeMaxRow(ctx context.Context, index string, c *pql.Call, reduceFn := func(prev, v interface{}) interface{} { // if minRowID exists, and if it is smaller than the other one return it. // otherwise return the minRowID of the one which exists. - prevp, _ := prev.(Pair) - vp, _ := v.(Pair) - if prevp.Count > 0 && vp.Count > 0 { - if prevp.ID > vp.ID { + if prev == nil { + return v + } else if v == nil { + return prev + } + prevp, _ := prev.(PairField) + vp, _ := v.(PairField) + if prevp.Pair.Count > 0 && vp.Pair.Count > 0 { + if prevp.Pair.ID > vp.Pair.ID { return prevp } return vp - } else if prevp.Count > 0 { + } else if prevp.Pair.Count > 0 { return prevp } return vp @@ -1175,12 +1185,12 @@ func (e *executor) executeMaxShard(ctx context.Context, index string, c *pql.Cal } // executeMinRowShard returns the minimum row ID for a shard. -func (e *executor) executeMinRowShard(ctx context.Context, index string, c *pql.Call, shard uint64) (Pair, error) { +func (e *executor) executeMinRowShard(ctx context.Context, index string, c *pql.Call, shard uint64) (PairField, error) { var filter *Row if len(c.Children) == 1 { row, err := e.executeBitmapCallShard(ctx, index, c.Children[0], shard) if err != nil { - return Pair{}, err + return PairField{}, err } filter = row } @@ -1188,28 +1198,31 @@ func (e *executor) executeMinRowShard(ctx context.Context, index string, c *pql. fieldName, _ := c.Args["field"].(string) field := e.Holder.Field(index, fieldName) if field == nil { - return Pair{}, nil + return PairField{}, nil } fragment := e.Holder.fragment(index, fieldName, viewStandard, shard) if fragment == nil { - return Pair{}, nil + return PairField{}, nil } minRowID, count := fragment.minRow(filter) - return Pair{ - ID: minRowID, - Count: count, + return PairField{ + Pair: Pair{ + ID: minRowID, + Count: count, + }, + Field: fieldName, }, nil } // executeMaxRowShard returns the maximum row ID for a shard. -func (e *executor) executeMaxRowShard(ctx context.Context, index string, c *pql.Call, shard uint64) (Pair, error) { +func (e *executor) executeMaxRowShard(ctx context.Context, index string, c *pql.Call, shard uint64) (PairField, error) { var filter *Row if len(c.Children) == 1 { row, err := e.executeBitmapCallShard(ctx, index, c.Children[0], shard) if err != nil { - return Pair{}, err + return PairField{}, err } filter = row } @@ -1217,25 +1230,28 @@ func (e *executor) executeMaxRowShard(ctx context.Context, index string, c *pql. fieldName, _ := c.Args["field"].(string) field := e.Holder.Field(index, fieldName) if field == nil { - return Pair{}, nil + return PairField{}, nil } fragment := e.Holder.fragment(index, fieldName, viewStandard, shard) if fragment == nil { - return Pair{}, nil + return PairField{}, nil } maxRowID, count := fragment.maxRow(filter) - return Pair{ - ID: maxRowID, - Count: count, + return PairField{ + Pair: Pair{ + ID: maxRowID, + Count: count, + }, + Field: fieldName, }, nil } // executeTopN executes a TopN() call. // This first performs the TopN() to determine the top results and then // requeries to retrieve the full counts for each of the top results. -func (e *executor) executeTopN(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) ([]Pair, error) { +func (e *executor) executeTopN(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) (*PairsField, error) { span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeTopN") defer span.Finish() @@ -1243,6 +1259,8 @@ func (e *executor) executeTopN(ctx context.Context, index string, c *pql.Call, s if err != nil { return nil, fmt.Errorf("executeTopN: %v", err) } + + fieldName, _ := c.Args["_field"].(string) n, _, err := c.UintArg("n") if err != nil { return nil, fmt.Errorf("executeTopN: %v", err) @@ -1256,13 +1274,16 @@ func (e *executor) executeTopN(ctx context.Context, index string, c *pql.Call, s // If this call is against specific ids, or we didn't get results, // or we are part of a larger distributed query then don't refetch. - if len(pairs) == 0 || len(idsArg) > 0 || opt.Remote { - return pairs, nil + if len(pairs.Pairs) == 0 || len(idsArg) > 0 || opt.Remote { + return &PairsField{ + Pairs: pairs.Pairs, + Field: fieldName, + }, nil } // Only the original caller should refetch the full counts. other := c.Clone() - ids := Pairs(pairs).Keys() + ids := Pairs(pairs.Pairs).Keys() sort.Sort(uint64Slice(ids)) other.Args["ids"] = ids @@ -1271,13 +1292,17 @@ func (e *executor) executeTopN(ctx context.Context, index string, c *pql.Call, s return nil, errors.Wrap(err, "retrieving full counts") } - if n != 0 && int(n) < len(trimmedList) { - trimmedList = trimmedList[0:n] + if n != 0 && int(n) < len(trimmedList.Pairs) { + trimmedList.Pairs = trimmedList.Pairs[0:n] } - return trimmedList, nil + + return &PairsField{ + Pairs: trimmedList.Pairs, + Field: fieldName, + }, nil } -func (e *executor) executeTopNShards(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) ([]Pair, error) { +func (e *executor) executeTopNShards(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) (*PairsField, error) { span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeTopNShards") defer span.Finish() @@ -1288,24 +1313,31 @@ func (e *executor) executeTopNShards(ctx context.Context, index string, c *pql.C // Merge returned results at coordinating node. reduceFn := func(prev, v interface{}) interface{} { - other, _ := prev.([]Pair) - return Pairs(other).Add(v.([]Pair)) + other, _ := prev.(*PairsField) + vpf, _ := v.(*PairsField) + if other == nil { + return vpf + } else if vpf == nil { + return other + } + other.Pairs = Pairs(other.Pairs).Add(vpf.Pairs) + return other } other, err := e.mapReduce(ctx, index, shards, c, opt, mapFn, reduceFn) if err != nil { return nil, err } - results, _ := other.([]Pair) + results, _ := other.(*PairsField) // Sort final merged results. - sort.Sort(Pairs(results)) + sort.Sort(Pairs(results.Pairs)) return results, nil } // executeTopNShard executes a TopN call for a single shard. -func (e *executor) executeTopNShard(ctx context.Context, index string, c *pql.Call, shard uint64) ([]Pair, error) { +func (e *executor) executeTopNShard(ctx context.Context, index string, c *pql.Call, shard uint64) (*PairsField, error) { span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeTopNShard") defer span.Finish() @@ -1351,7 +1383,7 @@ func (e *executor) executeTopNShard(ctx context.Context, index string, c *pql.Ca f := e.Holder.fragment(index, fieldName, viewStandard, shard) if f == nil { - return nil, nil + return &PairsField{}, nil } else if f.CacheType == CacheTypeNone { return nil, fmt.Errorf("cannot compute TopN(), field has no cache: %q", fieldName) } @@ -1363,7 +1395,7 @@ func (e *executor) executeTopNShard(ctx context.Context, index string, c *pql.Ca if tanimotoThreshold > 100 { return nil, errors.New("Tanimoto Threshold is from 1 to 100 only") } - return f.top(topOptions{ + pairs, err := f.top(topOptions{ N: int(n), Src: src, RowIDs: rowIDs, @@ -1372,6 +1404,13 @@ func (e *executor) executeTopNShard(ctx context.Context, index string, c *pql.Ca MinThreshold: minThreshold, TanimotoThreshold: tanimotoThreshold, }) + if err != nil { + return nil, errors.Wrap(err, "getting top") + } + + return &PairsField{ + Pairs: pairs, + }, nil } // executeDifferenceShard executes a difference() call for a local shard. @@ -1405,8 +1444,14 @@ func (e *executor) executeDifferenceShard(ctx context.Context, index string, c * // Row query which returns `Columns` and `Keys`. // TODO: Rename this to something better. Anything. type RowIdentifiers struct { - Rows []uint64 `json:"rows"` - Keys []string `json:"keys,omitempty"` + Rows []uint64 `json:"rows"` + Keys []string `json:"keys,omitempty"` + field string +} + +// Field returns the field name associated to the row. +func (r *RowIdentifiers) Field() string { + return r.field } // RowIDs is a query return type for just uint64 row ids. @@ -3535,41 +3580,47 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res return other, nil } - case Pair: + case PairField: if fieldName := callArgString(call, "field"); fieldName != "" { field := idx.Field(fieldName) if field == nil { return nil, fmt.Errorf("field %q not found", fieldName) } if field.keys() { - key, err := field.translateStore.TranslateID(result.ID) + key, err := field.translateStore.TranslateID(result.Pair.ID) if err != nil { return nil, err } if call.Name == "MinRow" || call.Name == "MaxRow" { - result.Key = key + result.Pair.Key = key return result, nil } - return Pair{Key: key, Count: result.Count}, nil + return PairField{ + Pair: Pair{Key: key, Count: result.Pair.Count}, + Field: fieldName, + }, nil } } - case []Pair: + case *PairsField: if fieldName := callArgString(call, "_field"); fieldName != "" { field := idx.Field(fieldName) if field == nil { return nil, fmt.Errorf("field %q not found", fieldName) } if field.keys() { - other := make([]Pair, len(result)) - for i := range result { - key, err := field.translateStore.TranslateID(result[i].ID) + other := make([]Pair, len(result.Pairs)) + for i := range result.Pairs { + key, err := field.translateStore.TranslateID(result.Pairs[i].ID) if err != nil { return nil, err } - other[i] = Pair{Key: key, Count: result[i].Count} + other[i] = Pair{Key: key, Count: result.Pairs[i].Count} } - return other, nil + return &PairsField{ + Pairs: other, + Field: fieldName, + }, nil } } @@ -3604,13 +3655,15 @@ func (e *executor) translateResult(index string, idx *Index, call *pql.Call, res return other, nil case RowIDs: - other := RowIdentifiers{} - fieldName := callArgString(call, "_field") if fieldName == "" { return nil, ErrFieldNotFound } + other := RowIdentifiers{ + field: fieldName, + } + if field := idx.Field(fieldName); field == nil { return nil, ErrFieldNotFound } else if field.keys() { diff --git a/executor_test.go b/executor_test.go index cea26c8af..665ef9bba 100644 --- a/executor_test.go +++ b/executor_test.go @@ -945,9 +945,12 @@ func TestExecutor_Execute_TopN(t *testing.T) { if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=2)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results[0], []pilosa.Pair{ - {ID: 0, Count: 5}, - {ID: 10, Count: 2}, + } else if !reflect.DeepEqual(result.Results[0], &pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 0, Count: 5}, + {ID: 10, Count: 2}, + }, + Field: "f", }) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -986,9 +989,12 @@ func TestExecutor_Execute_TopN(t *testing.T) { if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=2)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results[0], []pilosa.Pair{ - {ID: 0, Count: 5}, - {ID: 10, Count: 2}, + } else if !reflect.DeepEqual(result.Results[0], &pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 0, Count: 5}, + {ID: 10, Count: 2}, + }, + Field: "f", }) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1027,11 +1033,16 @@ func TestExecutor_Execute_TopN(t *testing.T) { if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=2)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results[0], []pilosa.Pair{ - {Key: "zero", Count: 5}, - {Key: "ten", Count: 2}, - }) { - t.Fatalf("unexpected result: %s", spew.Sdump(result)) + } else { + if !reflect.DeepEqual(result.Results[0], &pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {Key: "zero", Count: 5}, + {Key: "ten", Count: 2}, + }, + Field: "f", + }) { + t.Fatalf("unexpected result: %s", spew.Sdump(result)) + } } }) @@ -1069,9 +1080,12 @@ func TestExecutor_Execute_TopN(t *testing.T) { if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=2)`}); err != nil { t.Fatal(err) } else if diff := cmp.Diff(result.Results, []interface{}{ - []pilosa.Pair{ - {Key: "foo", Count: 5}, - {Key: "bar", Count: 2}, + &pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {Key: "foo", Count: 5}, + {Key: "bar", Count: 2}, + }, + Field: "f", }, }); diff != "" { t.Fatal(diff) @@ -1154,8 +1168,11 @@ func TestExecutor_Execute_TopN_fill(t *testing.T) { // Execute query. if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=1)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results, []interface{}{[]pilosa.Pair{ - {ID: 0, Count: 4}, + } else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 0, Count: 4}, + }, + Field: "f", }}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1188,8 +1205,11 @@ func TestExecutor_Execute_TopN_fill_small(t *testing.T) { // Execute query. if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=1)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results, []interface{}{[]pilosa.Pair{ - {ID: 0, Count: 5}, + } else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 0, Count: 5}, + }, + Field: "f", }}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1224,10 +1244,13 @@ func TestExecutor_Execute_TopN_Src(t *testing.T) { // Execute query. if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, Row(other=100), n=3)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results, []interface{}{[]pilosa.Pair{ - {ID: 20, Count: 3}, - {ID: 10, Count: 2}, - {ID: 0, Count: 1}, + } else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 20, Count: 3}, + {ID: 10, Count: 2}, + {ID: 0, Count: 1}, + }, + Field: "f", }}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1247,8 +1270,11 @@ func TestExecutor_Execute_TopN_Attr(t *testing.T) { } if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=1, attrName="category", attrValues=[123])`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results, []interface{}{[]pilosa.Pair{ - {ID: 10, Count: 1}, + } else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 10, Count: 1}, + }, + Field: "f", }}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1270,8 +1296,11 @@ func TestExecutor_Execute_TopN_Attr_Src(t *testing.T) { } if result, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, Row(f=10), n=1, attrName="category", attrValues=[123])`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(result.Results, []interface{}{[]pilosa.Pair{ - {ID: 10, Count: 1}, + } else if !reflect.DeepEqual(result.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 10, Count: 1}, + }, + Field: "f", }}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) } @@ -1465,7 +1494,10 @@ func TestExecutor_Execute_MinMaxRow(t *testing.T) { if err != nil { t.Fatal(err) } - target := pilosa.Pair{ID: 1, Count: 1} + target := pilosa.PairField{ + Pair: pilosa.Pair{ID: 1, Count: 1}, + Field: "f", + } if !reflect.DeepEqual(target, result.Results[0]) { t.Fatalf("unexpected result %v != %v", target, result.Results[0]) } @@ -1476,7 +1508,10 @@ func TestExecutor_Execute_MinMaxRow(t *testing.T) { if err != nil { t.Fatal(err) } - target := pilosa.Pair{ID: 10000, Count: 1} + target := pilosa.PairField{ + Pair: pilosa.Pair{ID: 10000, Count: 1}, + Field: "f", + } if !reflect.DeepEqual(target, result.Results[0]) { t.Fatalf("unexpected result %v != %v", target, result.Results[0]) } @@ -1512,7 +1547,10 @@ func TestExecutor_Execute_MinMaxRow(t *testing.T) { if err != nil { t.Fatal(err) } - target := pilosa.Pair{Key: "seven-thousand", ID: 1, Count: 1} + target := pilosa.PairField{ + Pair: pilosa.Pair{Key: "seven-thousand", ID: 1, Count: 1}, + Field: "f", + } if !reflect.DeepEqual(target, result.Results[0]) { t.Fatalf("unexpected result %v != %v", target, result.Results[0]) } @@ -1523,7 +1561,10 @@ func TestExecutor_Execute_MinMaxRow(t *testing.T) { if err != nil { t.Fatal(err) } - target := pilosa.Pair{Key: "five-thousand", ID: 5, Count: 1} + target := pilosa.PairField{ + Pair: pilosa.Pair{Key: "five-thousand", ID: 5, Count: 1}, + Field: "f", + } if !reflect.DeepEqual(target, result.Results[0]) { t.Fatalf("unexpected result %v != %v", target, result.Results[0]) } @@ -2420,7 +2461,6 @@ func TestExecutor_Execute_Remote_Row(t *testing.T) { if err != nil { t.Fatalf("creating field: %v", err) } - if _, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: ` Set(500001, fn=5) Set(1500001, fn=5) @@ -2432,11 +2472,11 @@ Set(3500003, fn=3) Set(500001, fn=4) Set(4500001, fn=4) `}); err != nil { - t.Fatalf("quuerying remote: %v", err) + t.Fatalf("querying remote: %v", err) } err := c[0].API.RecalculateCaches(context.Background()) if err != nil { - t.Fatalf("recalcing caches: %v", err) + t.Fatalf("recalculating caches: %v", err) } if res, err := c[1].API.Query(context.Background(), &pilosa.QueryRequest{ @@ -2444,10 +2484,13 @@ Set(4500001, fn=4) Query: `TopN(fn, n=3)`, }); err != nil { t.Fatalf("topn querying: %v", err) - } else if !reflect.DeepEqual(res.Results, []interface{}{[]pilosa.Pair{ - {ID: 5, Count: 4}, - {ID: 3, Count: 3}, - {ID: 4, Count: 2}, + } else if !reflect.DeepEqual(res.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 5, Count: 4}, + {ID: 3, Count: 3}, + {ID: 4, Count: 2}, + }, + Field: "fn", }}) { t.Fatalf("topn wrong results: %v", res.Results) } @@ -3039,10 +3082,13 @@ func TestExecutor_Execute_ClearRow(t *testing.T) { // Check the TopN results. if res, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=5)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(res.Results, []interface{}{[]pilosa.Pair{ - {ID: 1, Count: 7}, - {ID: 2, Count: 6}, - {ID: 3, Count: 5}, + } else if !reflect.DeepEqual(res.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 1, Count: 7}, + {ID: 2, Count: 6}, + {ID: 3, Count: 5}, + }, + Field: "f", }}) { t.Fatalf("topn wrong results: %v", res.Results) } @@ -3057,9 +3103,12 @@ func TestExecutor_Execute_ClearRow(t *testing.T) { // Ensure that the cleared row doesn't show up in TopN (i.e. it was removed from the cache). if res, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: `TopN(f, n=5)`}); err != nil { t.Fatal(err) - } else if !reflect.DeepEqual(res.Results, []interface{}{[]pilosa.Pair{ - {ID: 1, Count: 7}, - {ID: 3, Count: 5}, + } else if !reflect.DeepEqual(res.Results, []interface{}{&pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {ID: 1, Count: 7}, + {ID: 3, Count: 5}, + }, + Field: "f", }}) { t.Fatalf("topn wrong results: %v", res.Results) } @@ -3280,30 +3329,40 @@ func TestExecutor_Execute_Rows(t *testing.T) { }) rows := c.Query(t, "i", `Rows(general)`).Results[0].(pilosa.RowIdentifiers) - if !reflect.DeepEqual(rows, pilosa.RowIdentifiers{Rows: []uint64{10, 11, 12, 13}}) { - t.Fatalf("unexpected rows: %+v", rows) + if !reflect.DeepEqual(rows.Rows, []uint64{10, 11, 12, 13}) { + t.Fatalf("unexpected rows: %+v", rows.Rows) + } else if rows.Keys != nil { + t.Fatalf("unexpected keys: %+v", rows.Keys) } // backwards compatibility // TODO: remove at Pilosa 2.0 rows = c.Query(t, "i", `Rows(field=general)`).Results[0].(pilosa.RowIdentifiers) - if !reflect.DeepEqual(rows, pilosa.RowIdentifiers{Rows: []uint64{10, 11, 12, 13}}) { - t.Fatalf("unexpected rows: %+v", rows) + if !reflect.DeepEqual(rows.Rows, []uint64{10, 11, 12, 13}) { + t.Fatalf("unexpected rows: %+v", rows.Rows) + } else if rows.Keys != nil { + t.Fatalf("unexpected keys: %+v", rows.Keys) } rows = c.Query(t, "i", `Rows(general, limit=2)`).Results[0].(pilosa.RowIdentifiers) - if !reflect.DeepEqual(rows, pilosa.RowIdentifiers{Rows: []uint64{10, 11}}) { - t.Fatalf("unexpected rows: %+v", rows) + if !reflect.DeepEqual(rows.Rows, []uint64{10, 11}) { + t.Fatalf("unexpected rows: %+v", rows.Rows) + } else if rows.Keys != nil { + t.Fatalf("unexpected keys: %+v", rows.Keys) } rows = c.Query(t, "i", `Rows(general, previous=10,limit=2)`).Results[0].(pilosa.RowIdentifiers) - if !reflect.DeepEqual(rows, pilosa.RowIdentifiers{Rows: []uint64{11, 12}}) { - t.Fatalf("unexpected rows: %+v", rows) + if !reflect.DeepEqual(rows.Rows, []uint64{11, 12}) { + t.Fatalf("unexpected rows: %+v", rows.Rows) + } else if rows.Keys != nil { + t.Fatalf("unexpected keys: %+v", rows.Keys) } rows = c.Query(t, "i", `Rows(general, column=2)`).Results[0].(pilosa.RowIdentifiers) - if !reflect.DeepEqual(rows, pilosa.RowIdentifiers{Rows: []uint64{11, 12}}) { - t.Fatalf("unexpected rows: %+v", rows) + if !reflect.DeepEqual(rows.Rows, []uint64{11, 12}) { + t.Fatalf("unexpected rows: %+v", rows.Rows) + } else if rows.Keys != nil { + t.Fatalf("unexpected keys: %+v", rows.Keys) } } @@ -3613,9 +3672,13 @@ func TestExecutor_Execute_Rows_Keys(t *testing.T) { t.Run(fmt.Sprintf("#%d_%s", i, test.q), func(t *testing.T) { if res, err := c[0].API.Query(context.Background(), &pilosa.QueryRequest{Index: "i", Query: test.q}); err != nil { t.Fatal(err) - } else if rows := res.Results[0].(pilosa.RowIdentifiers); !reflect.DeepEqual( - rows, pilosa.RowIdentifiers{Keys: test.exp}) { - t.Fatalf("\ngot: %+v\nexp: %+v", rows, pilosa.RowIdentifiers{Keys: test.exp}) + } else { + rows := res.Results[0].(pilosa.RowIdentifiers) + if !reflect.DeepEqual(rows.Keys, test.exp) { + t.Fatalf("\ngot: %+v\nexp: %+v", rows.Keys, test.exp) + } else if rows.Rows != nil { + t.Fatalf("\ngot: %+v\nexp: nil", rows.Rows) + } } }) } diff --git a/http/client_test.go b/http/client_test.go index f8743555e..077a11ff4 100644 --- a/http/client_test.go +++ b/http/client_test.go @@ -148,7 +148,8 @@ func TestClient_MultiNode(t *testing.T) { } // Test must return exactly N results. - if len(result.Results[0].([]pilosa.Pair)) != topN { + pairsField := result.Results[0].(*pilosa.PairsField) + if len(pairsField.Pairs) != topN { t.Fatalf("unexpected number of TopN results: %s", spew.Sdump(result)) } p := []pilosa.Pair{ @@ -158,7 +159,7 @@ func TestClient_MultiNode(t *testing.T) { {ID: 99, Count: 7}} // Valdidate the Top 4 result counts. - if !reflect.DeepEqual(result.Results[0].([]pilosa.Pair), p) { + if !reflect.DeepEqual(pairsField.Pairs, p) { t.Fatalf("Invalid TopN result set: %s", spew.Sdump(result)) } @@ -605,14 +606,14 @@ func TestClient_ImportKeys(t *testing.T) { Index: "keyed", Query: "TopN(keyedf)", }) - if pairs, ok := resp.Results[0].([]pilosa.Pair); !ok { + if pairs, ok := resp.Results[0].(*pilosa.PairsField); !ok { t.Fatalf("unexpected response type %T", resp.Results[0]) - } else if !reflect.DeepEqual(pairs, []pilosa.Pair{ + } else if !reflect.DeepEqual(pairs.Pairs, []pilosa.Pair{ {Key: "green", Count: 3}, {Key: "blue", Count: 2}, {Key: "purple", Count: 1}, }) { - t.Fatalf("unexpected topn result: %v", pairs) + t.Fatalf("unexpected topn result: %v", pairs.Pairs) } }) @@ -632,14 +633,14 @@ func TestClient_ImportKeys(t *testing.T) { Index: "keyed", Query: "TopN(unkeyedf)", }) - if pairs, ok := resp.Results[0].([]pilosa.Pair); !ok { + if pairs, ok := resp.Results[0].(*pilosa.PairsField); !ok { t.Fatalf("unexpected response type %T", resp.Results[0]) - } else if !reflect.DeepEqual(pairs, []pilosa.Pair{ + } else if !reflect.DeepEqual(pairs.Pairs, []pilosa.Pair{ {ID: 1, Count: 3}, {ID: 2, Count: 2}, {ID: 3, Count: 1}, }) { - t.Fatalf("unexpected topn result: %v", pairs) + t.Fatalf("unexpected topn result: %v", pairs.Pairs) } }) @@ -659,14 +660,14 @@ func TestClient_ImportKeys(t *testing.T) { Index: "unkeyed", Query: "TopN(keyedf)", }) - if pairs, ok := resp.Results[0].([]pilosa.Pair); !ok { + if pairs, ok := resp.Results[0].(*pilosa.PairsField); !ok { t.Fatalf("unexpected response type %T", resp.Results[0]) - } else if !reflect.DeepEqual(pairs, []pilosa.Pair{ + } else if !reflect.DeepEqual(pairs.Pairs, []pilosa.Pair{ {Key: "green", Count: 3}, {Key: "blue", Count: 2}, {Key: "purple", Count: 1}, }) { - t.Fatalf("unexpected topn result: %v", pairs) + t.Fatalf("unexpected topn result: %v", pairs.Pairs) } }) }) @@ -704,14 +705,14 @@ func TestClient_ImportKeys(t *testing.T) { Index: "keyed", Query: "TopN(keyedf0)", }) - if pairs, ok := resp.Results[0].([]pilosa.Pair); !ok { + if pairs, ok := resp.Results[0].(*pilosa.PairsField); !ok { t.Fatalf("unexpected response type %T", resp.Results[0]) - } else if !reflect.DeepEqual(pairs, []pilosa.Pair{ + } else if !reflect.DeepEqual(pairs.Pairs, []pilosa.Pair{ {Key: "green", Count: 3}, {Key: "blue", Count: 2}, {Key: "purple", Count: 1}, }) { - t.Fatalf("unexpected topn result: %v", pairs) + t.Fatalf("unexpected topn result: %v", pairs.Pairs) } }) @@ -736,14 +737,14 @@ func TestClient_ImportKeys(t *testing.T) { Index: "keyed", Query: "TopN(keyedf1)", }) - if pairs, ok := resp.Results[0].([]pilosa.Pair); !ok { + if pairs, ok := resp.Results[0].(*pilosa.PairsField); !ok { t.Fatalf("unexpected response type %T", resp.Results[0]) - } else if !reflect.DeepEqual(pairs, []pilosa.Pair{ + } else if !reflect.DeepEqual(pairs.Pairs, []pilosa.Pair{ {Key: "green", Count: 3}, {Key: "blue", Count: 2}, {Key: "purple", Count: 1}, }) { - t.Fatalf("unexpected topn result: %#v", pairs) + t.Fatalf("unexpected topn result: %#v", pairs.Pairs) } }) }) diff --git a/internal/private.pb.go b/internal/private.pb.go index 755370e74..d42e410cf 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -32,7 +32,7 @@ func (m *IndexMeta) Reset() { *m = IndexMeta{} } func (m *IndexMeta) String() string { return proto.CompactTextString(m) } func (*IndexMeta) ProtoMessage() {} func (*IndexMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{0} + return fileDescriptor_private_e6d12fddb5948a73, []int{0} } func (m *IndexMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -96,7 +96,7 @@ func (m *FieldOptions) Reset() { *m = FieldOptions{} } func (m *FieldOptions) String() string { return proto.CompactTextString(m) } func (*FieldOptions) ProtoMessage() {} func (*FieldOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{1} + return fileDescriptor_private_e6d12fddb5948a73, []int{1} } func (m *FieldOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -213,7 +213,7 @@ func (m *ImportResponse) Reset() { *m = ImportResponse{} } func (m *ImportResponse) String() string { return proto.CompactTextString(m) } func (*ImportResponse) ProtoMessage() {} func (*ImportResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{2} + return fileDescriptor_private_e6d12fddb5948a73, []int{2} } func (m *ImportResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -264,7 +264,7 @@ func (m *BlockDataRequest) Reset() { *m = BlockDataRequest{} } func (m *BlockDataRequest) String() string { return proto.CompactTextString(m) } func (*BlockDataRequest) ProtoMessage() {} func (*BlockDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{3} + return fileDescriptor_private_e6d12fddb5948a73, []int{3} } func (m *BlockDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -340,7 +340,7 @@ func (m *BlockDataResponse) Reset() { *m = BlockDataResponse{} } func (m *BlockDataResponse) String() string { return proto.CompactTextString(m) } func (*BlockDataResponse) ProtoMessage() {} func (*BlockDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{4} + return fileDescriptor_private_e6d12fddb5948a73, []int{4} } func (m *BlockDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -394,7 +394,7 @@ func (m *Cache) Reset() { *m = Cache{} } func (m *Cache) String() string { return proto.CompactTextString(m) } func (*Cache) ProtoMessage() {} func (*Cache) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{5} + return fileDescriptor_private_e6d12fddb5948a73, []int{5} } func (m *Cache) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -441,7 +441,7 @@ func (m *MaxShards) Reset() { *m = MaxShards{} } func (m *MaxShards) String() string { return proto.CompactTextString(m) } func (*MaxShards) ProtoMessage() {} func (*MaxShards) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{6} + return fileDescriptor_private_e6d12fddb5948a73, []int{6} } func (m *MaxShards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -490,7 +490,7 @@ func (m *CreateShardMessage) Reset() { *m = CreateShardMessage{} } func (m *CreateShardMessage) String() string { return proto.CompactTextString(m) } func (*CreateShardMessage) ProtoMessage() {} func (*CreateShardMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{7} + return fileDescriptor_private_e6d12fddb5948a73, []int{7} } func (m *CreateShardMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -551,7 +551,7 @@ func (m *DeleteIndexMessage) Reset() { *m = DeleteIndexMessage{} } func (m *DeleteIndexMessage) String() string { return proto.CompactTextString(m) } func (*DeleteIndexMessage) ProtoMessage() {} func (*DeleteIndexMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{8} + return fileDescriptor_private_e6d12fddb5948a73, []int{8} } func (m *DeleteIndexMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -599,7 +599,7 @@ func (m *CreateIndexMessage) Reset() { *m = CreateIndexMessage{} } func (m *CreateIndexMessage) String() string { return proto.CompactTextString(m) } func (*CreateIndexMessage) ProtoMessage() {} func (*CreateIndexMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{9} + return fileDescriptor_private_e6d12fddb5948a73, []int{9} } func (m *CreateIndexMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,7 +655,7 @@ func (m *CreateFieldMessage) Reset() { *m = CreateFieldMessage{} } func (m *CreateFieldMessage) String() string { return proto.CompactTextString(m) } func (*CreateFieldMessage) ProtoMessage() {} func (*CreateFieldMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{10} + return fileDescriptor_private_e6d12fddb5948a73, []int{10} } func (m *CreateFieldMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -717,7 +717,7 @@ func (m *DeleteFieldMessage) Reset() { *m = DeleteFieldMessage{} } func (m *DeleteFieldMessage) String() string { return proto.CompactTextString(m) } func (*DeleteFieldMessage) ProtoMessage() {} func (*DeleteFieldMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{11} + return fileDescriptor_private_e6d12fddb5948a73, []int{11} } func (m *DeleteFieldMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -773,7 +773,7 @@ func (m *DeleteAvailableShardMessage) Reset() { *m = DeleteAvailableShar func (m *DeleteAvailableShardMessage) String() string { return proto.CompactTextString(m) } func (*DeleteAvailableShardMessage) ProtoMessage() {} func (*DeleteAvailableShardMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{12} + return fileDescriptor_private_e6d12fddb5948a73, []int{12} } func (m *DeleteAvailableShardMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -836,7 +836,7 @@ func (m *Field) Reset() { *m = Field{} } func (m *Field) String() string { return proto.CompactTextString(m) } func (*Field) ProtoMessage() {} func (*Field) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{13} + return fileDescriptor_private_e6d12fddb5948a73, []int{13} } func (m *Field) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -897,7 +897,7 @@ func (m *Schema) Reset() { *m = Schema{} } func (m *Schema) String() string { return proto.CompactTextString(m) } func (*Schema) ProtoMessage() {} func (*Schema) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{14} + return fileDescriptor_private_e6d12fddb5948a73, []int{14} } func (m *Schema) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -945,7 +945,7 @@ func (m *Index) Reset() { *m = Index{} } func (m *Index) String() string { return proto.CompactTextString(m) } func (*Index) ProtoMessage() {} func (*Index) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{15} + return fileDescriptor_private_e6d12fddb5948a73, []int{15} } func (m *Index) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1001,7 +1001,7 @@ func (m *URI) Reset() { *m = URI{} } func (m *URI) String() string { return proto.CompactTextString(m) } func (*URI) ProtoMessage() {} func (*URI) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{16} + return fileDescriptor_private_e6d12fddb5948a73, []int{16} } func (m *URI) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1065,7 +1065,7 @@ func (m *Node) Reset() { *m = Node{} } func (m *Node) String() string { return proto.CompactTextString(m) } func (*Node) ProtoMessage() {} func (*Node) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{17} + return fileDescriptor_private_e6d12fddb5948a73, []int{17} } func (m *Node) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1134,7 +1134,7 @@ func (m *NodeStateMessage) Reset() { *m = NodeStateMessage{} } func (m *NodeStateMessage) String() string { return proto.CompactTextString(m) } func (*NodeStateMessage) ProtoMessage() {} func (*NodeStateMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{18} + return fileDescriptor_private_e6d12fddb5948a73, []int{18} } func (m *NodeStateMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1189,7 +1189,7 @@ func (m *NodeEventMessage) Reset() { *m = NodeEventMessage{} } func (m *NodeEventMessage) String() string { return proto.CompactTextString(m) } func (*NodeEventMessage) ProtoMessage() {} func (*NodeEventMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{19} + return fileDescriptor_private_e6d12fddb5948a73, []int{19} } func (m *NodeEventMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1245,7 +1245,7 @@ func (m *NodeStatus) Reset() { *m = NodeStatus{} } func (m *NodeStatus) String() string { return proto.CompactTextString(m) } func (*NodeStatus) ProtoMessage() {} func (*NodeStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{20} + return fileDescriptor_private_e6d12fddb5948a73, []int{20} } func (m *NodeStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1307,7 +1307,7 @@ func (m *IndexStatus) Reset() { *m = IndexStatus{} } func (m *IndexStatus) String() string { return proto.CompactTextString(m) } func (*IndexStatus) ProtoMessage() {} func (*IndexStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{21} + return fileDescriptor_private_e6d12fddb5948a73, []int{21} } func (m *IndexStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1362,7 +1362,7 @@ func (m *FieldStatus) Reset() { *m = FieldStatus{} } func (m *FieldStatus) String() string { return proto.CompactTextString(m) } func (*FieldStatus) ProtoMessage() {} func (*FieldStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{22} + return fileDescriptor_private_e6d12fddb5948a73, []int{22} } func (m *FieldStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1418,7 +1418,7 @@ func (m *ClusterStatus) Reset() { *m = ClusterStatus{} } func (m *ClusterStatus) String() string { return proto.CompactTextString(m) } func (*ClusterStatus) ProtoMessage() {} func (*ClusterStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{23} + return fileDescriptor_private_e6d12fddb5948a73, []int{23} } func (m *ClusterStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1482,7 +1482,7 @@ func (m *BSIGroup) Reset() { *m = BSIGroup{} } func (m *BSIGroup) String() string { return proto.CompactTextString(m) } func (*BSIGroup) ProtoMessage() {} func (*BSIGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{24} + return fileDescriptor_private_e6d12fddb5948a73, []int{24} } func (m *BSIGroup) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1552,7 +1552,7 @@ func (m *CreateViewMessage) Reset() { *m = CreateViewMessage{} } func (m *CreateViewMessage) String() string { return proto.CompactTextString(m) } func (*CreateViewMessage) ProtoMessage() {} func (*CreateViewMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{25} + return fileDescriptor_private_e6d12fddb5948a73, []int{25} } func (m *CreateViewMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1615,7 +1615,7 @@ func (m *DeleteViewMessage) Reset() { *m = DeleteViewMessage{} } func (m *DeleteViewMessage) String() string { return proto.CompactTextString(m) } func (*DeleteViewMessage) ProtoMessage() {} func (*DeleteViewMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{26} + return fileDescriptor_private_e6d12fddb5948a73, []int{26} } func (m *DeleteViewMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1681,7 +1681,7 @@ func (m *ResizeInstruction) Reset() { *m = ResizeInstruction{} } func (m *ResizeInstruction) String() string { return proto.CompactTextString(m) } func (*ResizeInstruction) ProtoMessage() {} func (*ResizeInstruction) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{27} + return fileDescriptor_private_e6d12fddb5948a73, []int{27} } func (m *ResizeInstruction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1767,7 +1767,7 @@ func (m *ResizeSource) Reset() { *m = ResizeSource{} } func (m *ResizeSource) String() string { return proto.CompactTextString(m) } func (*ResizeSource) ProtoMessage() {} func (*ResizeSource) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{28} + return fileDescriptor_private_e6d12fddb5948a73, []int{28} } func (m *ResizeSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1844,7 +1844,7 @@ func (m *ResizeInstructionComplete) Reset() { *m = ResizeInstructionComp func (m *ResizeInstructionComplete) String() string { return proto.CompactTextString(m) } func (*ResizeInstructionComplete) ProtoMessage() {} func (*ResizeInstructionComplete) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{29} + return fileDescriptor_private_e6d12fddb5948a73, []int{29} } func (m *ResizeInstructionComplete) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1905,7 +1905,7 @@ func (m *SetCoordinatorMessage) Reset() { *m = SetCoordinatorMessage{} } func (m *SetCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*SetCoordinatorMessage) ProtoMessage() {} func (*SetCoordinatorMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{30} + return fileDescriptor_private_e6d12fddb5948a73, []int{30} } func (m *SetCoordinatorMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1952,7 +1952,7 @@ func (m *UpdateCoordinatorMessage) Reset() { *m = UpdateCoordinatorMessa func (m *UpdateCoordinatorMessage) String() string { return proto.CompactTextString(m) } func (*UpdateCoordinatorMessage) ProtoMessage() {} func (*UpdateCoordinatorMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{31} + return fileDescriptor_private_e6d12fddb5948a73, []int{31} } func (m *UpdateCoordinatorMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2000,7 +2000,7 @@ func (m *Topology) Reset() { *m = Topology{} } func (m *Topology) String() string { return proto.CompactTextString(m) } func (*Topology) ProtoMessage() {} func (*Topology) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{32} + return fileDescriptor_private_e6d12fddb5948a73, []int{32} } func (m *Topology) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2053,7 +2053,7 @@ func (m *RecalculateCaches) Reset() { *m = RecalculateCaches{} } func (m *RecalculateCaches) String() string { return proto.CompactTextString(m) } func (*RecalculateCaches) ProtoMessage() {} func (*RecalculateCaches) Descriptor() ([]byte, []int) { - return fileDescriptor_private_b229d027a4642df7, []int{33} + return fileDescriptor_private_e6d12fddb5948a73, []int{33} } func (m *RecalculateCaches) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -8982,9 +8982,9 @@ var ( ErrIntOverflowPrivate = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("private.proto", fileDescriptor_private_b229d027a4642df7) } +func init() { proto.RegisterFile("private.proto", fileDescriptor_private_e6d12fddb5948a73) } -var fileDescriptor_private_b229d027a4642df7 = []byte{ +var fileDescriptor_private_e6d12fddb5948a73 = []byte{ // 1174 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdb, 0x6e, 0x1b, 0x45, 0x18, 0x66, 0x0f, 0x71, 0xec, 0xdf, 0x71, 0x0e, 0xdb, 0x36, 0x6c, 0x0b, 0x0a, 0x66, 0x54, 0x51, diff --git a/internal/public.pb.go b/internal/public.pb.go index 731ae14c0..08ed42318 100644 --- a/internal/public.pb.go +++ b/internal/public.pb.go @@ -36,7 +36,7 @@ func (m *Row) Reset() { *m = Row{} } func (m *Row) String() string { return proto.CompactTextString(m) } func (*Row) ProtoMessage() {} func (*Row) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{0} + return fileDescriptor_public_48374b395a722341, []int{0} } func (m *Row) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -105,7 +105,7 @@ func (m *SignedRow) Reset() { *m = SignedRow{} } func (m *SignedRow) String() string { return proto.CompactTextString(m) } func (*SignedRow) ProtoMessage() {} func (*SignedRow) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{1} + return fileDescriptor_public_48374b395a722341, []int{1} } func (m *SignedRow) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -160,7 +160,7 @@ func (m *RowIdentifiers) Reset() { *m = RowIdentifiers{} } func (m *RowIdentifiers) String() string { return proto.CompactTextString(m) } func (*RowIdentifiers) ProtoMessage() {} func (*RowIdentifiers) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{2} + return fileDescriptor_public_48374b395a722341, []int{2} } func (m *RowIdentifiers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -216,7 +216,7 @@ func (m *Pair) Reset() { *m = Pair{} } func (m *Pair) String() string { return proto.CompactTextString(m) } func (*Pair) ProtoMessage() {} func (*Pair) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{3} + return fileDescriptor_public_48374b395a722341, []int{3} } func (m *Pair) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -266,6 +266,116 @@ func (m *Pair) GetCount() uint64 { return 0 } +type PairField struct { + Pair *Pair `protobuf:"bytes,1,opt,name=Pair" json:"Pair,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PairField) Reset() { *m = PairField{} } +func (m *PairField) String() string { return proto.CompactTextString(m) } +func (*PairField) ProtoMessage() {} +func (*PairField) Descriptor() ([]byte, []int) { + return fileDescriptor_public_48374b395a722341, []int{4} +} +func (m *PairField) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PairField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PairField.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *PairField) XXX_Merge(src proto.Message) { + xxx_messageInfo_PairField.Merge(dst, src) +} +func (m *PairField) XXX_Size() int { + return m.Size() +} +func (m *PairField) XXX_DiscardUnknown() { + xxx_messageInfo_PairField.DiscardUnknown(m) +} + +var xxx_messageInfo_PairField proto.InternalMessageInfo + +func (m *PairField) GetPair() *Pair { + if m != nil { + return m.Pair + } + return nil +} + +func (m *PairField) GetField() string { + if m != nil { + return m.Field + } + return "" +} + +type PairsField struct { + Pairs []*Pair `protobuf:"bytes,1,rep,name=Pairs" json:"Pairs,omitempty"` + Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PairsField) Reset() { *m = PairsField{} } +func (m *PairsField) String() string { return proto.CompactTextString(m) } +func (*PairsField) ProtoMessage() {} +func (*PairsField) Descriptor() ([]byte, []int) { + return fileDescriptor_public_48374b395a722341, []int{5} +} +func (m *PairsField) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PairsField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PairsField.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *PairsField) XXX_Merge(src proto.Message) { + xxx_messageInfo_PairsField.Merge(dst, src) +} +func (m *PairsField) XXX_Size() int { + return m.Size() +} +func (m *PairsField) XXX_DiscardUnknown() { + xxx_messageInfo_PairsField.DiscardUnknown(m) +} + +var xxx_messageInfo_PairsField proto.InternalMessageInfo + +func (m *PairsField) GetPairs() []*Pair { + if m != nil { + return m.Pairs + } + return nil +} + +func (m *PairsField) GetField() string { + if m != nil { + return m.Field + } + return "" +} + type FieldRow struct { Field string `protobuf:"bytes,1,opt,name=Field,proto3" json:"Field,omitempty"` RowID uint64 `protobuf:"varint,2,opt,name=RowID,proto3" json:"RowID,omitempty"` @@ -279,7 +389,7 @@ func (m *FieldRow) Reset() { *m = FieldRow{} } func (m *FieldRow) String() string { return proto.CompactTextString(m) } func (*FieldRow) ProtoMessage() {} func (*FieldRow) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{4} + return fileDescriptor_public_48374b395a722341, []int{6} } func (m *FieldRow) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -342,7 +452,7 @@ func (m *GroupCount) Reset() { *m = GroupCount{} } func (m *GroupCount) String() string { return proto.CompactTextString(m) } func (*GroupCount) ProtoMessage() {} func (*GroupCount) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{5} + return fileDescriptor_public_48374b395a722341, []int{7} } func (m *GroupCount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -404,7 +514,7 @@ func (m *ValCount) Reset() { *m = ValCount{} } func (m *ValCount) String() string { return proto.CompactTextString(m) } func (*ValCount) ProtoMessage() {} func (*ValCount) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{6} + return fileDescriptor_public_48374b395a722341, []int{8} } func (m *ValCount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,7 +570,7 @@ func (m *ColumnAttrSet) Reset() { *m = ColumnAttrSet{} } func (m *ColumnAttrSet) String() string { return proto.CompactTextString(m) } func (*ColumnAttrSet) ProtoMessage() {} func (*ColumnAttrSet) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{7} + return fileDescriptor_public_48374b395a722341, []int{9} } func (m *ColumnAttrSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -526,7 +636,7 @@ func (m *Attr) Reset() { *m = Attr{} } func (m *Attr) String() string { return proto.CompactTextString(m) } func (*Attr) ProtoMessage() {} func (*Attr) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{8} + return fileDescriptor_public_48374b395a722341, []int{10} } func (m *Attr) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -608,7 +718,7 @@ func (m *AttrMap) Reset() { *m = AttrMap{} } func (m *AttrMap) String() string { return proto.CompactTextString(m) } func (*AttrMap) ProtoMessage() {} func (*AttrMap) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{9} + return fileDescriptor_public_48374b395a722341, []int{11} } func (m *AttrMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,7 +771,7 @@ func (m *QueryRequest) Reset() { *m = QueryRequest{} } func (m *QueryRequest) String() string { return proto.CompactTextString(m) } func (*QueryRequest) ProtoMessage() {} func (*QueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{10} + return fileDescriptor_public_48374b395a722341, []int{12} } func (m *QueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -752,7 +862,7 @@ func (m *QueryResponse) Reset() { *m = QueryResponse{} } func (m *QueryResponse) String() string { return proto.CompactTextString(m) } func (*QueryResponse) ProtoMessage() {} func (*QueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{11} + return fileDescriptor_public_48374b395a722341, []int{13} } func (m *QueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -813,6 +923,7 @@ type QueryResult struct { GroupCounts []*GroupCount `protobuf:"bytes,8,rep,name=GroupCounts" json:"GroupCounts,omitempty"` RowIdentifiers *RowIdentifiers `protobuf:"bytes,9,opt,name=RowIdentifiers" json:"RowIdentifiers,omitempty"` SignedRow *SignedRow `protobuf:"bytes,10,opt,name=SignedRow" json:"SignedRow,omitempty"` + PairsField *PairsField `protobuf:"bytes,11,opt,name=PairsField" json:"PairsField,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -822,7 +933,7 @@ func (m *QueryResult) Reset() { *m = QueryResult{} } func (m *QueryResult) String() string { return proto.CompactTextString(m) } func (*QueryResult) ProtoMessage() {} func (*QueryResult) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{12} + return fileDescriptor_public_48374b395a722341, []int{14} } func (m *QueryResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -921,6 +1032,13 @@ func (m *QueryResult) GetSignedRow() *SignedRow { return nil } +func (m *QueryResult) GetPairsField() *PairsField { + if m != nil { + return m.PairsField + } + return nil +} + type ImportRequest struct { Index string `protobuf:"bytes,1,opt,name=Index,proto3" json:"Index,omitempty"` Field string `protobuf:"bytes,2,opt,name=Field,proto3" json:"Field,omitempty"` @@ -939,7 +1057,7 @@ func (m *ImportRequest) Reset() { *m = ImportRequest{} } func (m *ImportRequest) String() string { return proto.CompactTextString(m) } func (*ImportRequest) ProtoMessage() {} func (*ImportRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{13} + return fileDescriptor_public_48374b395a722341, []int{15} } func (m *ImportRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1041,7 +1159,7 @@ func (m *ImportValueRequest) Reset() { *m = ImportValueRequest{} } func (m *ImportValueRequest) String() string { return proto.CompactTextString(m) } func (*ImportValueRequest) ProtoMessage() {} func (*ImportValueRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{14} + return fileDescriptor_public_48374b395a722341, []int{16} } func (m *ImportValueRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1132,7 +1250,7 @@ func (m *TranslateKeysRequest) Reset() { *m = TranslateKeysRequest{} } func (m *TranslateKeysRequest) String() string { return proto.CompactTextString(m) } func (*TranslateKeysRequest) ProtoMessage() {} func (*TranslateKeysRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{15} + return fileDescriptor_public_48374b395a722341, []int{17} } func (m *TranslateKeysRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1193,7 +1311,7 @@ func (m *TranslateKeysResponse) Reset() { *m = TranslateKeysResponse{} } func (m *TranslateKeysResponse) String() string { return proto.CompactTextString(m) } func (*TranslateKeysResponse) ProtoMessage() {} func (*TranslateKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{16} + return fileDescriptor_public_48374b395a722341, []int{18} } func (m *TranslateKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1241,7 +1359,7 @@ func (m *ImportRoaringRequestView) Reset() { *m = ImportRoaringRequestVi func (m *ImportRoaringRequestView) String() string { return proto.CompactTextString(m) } func (*ImportRoaringRequestView) ProtoMessage() {} func (*ImportRoaringRequestView) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{17} + return fileDescriptor_public_48374b395a722341, []int{19} } func (m *ImportRoaringRequestView) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1296,7 +1414,7 @@ func (m *ImportRoaringRequest) Reset() { *m = ImportRoaringRequest{} } func (m *ImportRoaringRequest) String() string { return proto.CompactTextString(m) } func (*ImportRoaringRequest) ProtoMessage() {} func (*ImportRoaringRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{18} + return fileDescriptor_public_48374b395a722341, []int{20} } func (m *ImportRoaringRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1354,7 +1472,7 @@ func (m *ImportColumnAttrsRequest) Reset() { *m = ImportColumnAttrsReque func (m *ImportColumnAttrsRequest) String() string { return proto.CompactTextString(m) } func (*ImportColumnAttrsRequest) ProtoMessage() {} func (*ImportColumnAttrsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_public_568b1fcbeadcdcca, []int{19} + return fileDescriptor_public_48374b395a722341, []int{21} } func (m *ImportColumnAttrsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1423,6 +1541,8 @@ func init() { proto.RegisterType((*SignedRow)(nil), "internal.SignedRow") proto.RegisterType((*RowIdentifiers)(nil), "internal.RowIdentifiers") proto.RegisterType((*Pair)(nil), "internal.Pair") + proto.RegisterType((*PairField)(nil), "internal.PairField") + proto.RegisterType((*PairsField)(nil), "internal.PairsField") proto.RegisterType((*FieldRow)(nil), "internal.FieldRow") proto.RegisterType((*GroupCount)(nil), "internal.GroupCount") proto.RegisterType((*ValCount)(nil), "internal.ValCount") @@ -1642,6 +1762,82 @@ func (m *Pair) MarshalTo(dAtA []byte) (int, error) { return i, nil } +func (m *PairField) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PairField) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Pair != nil { + dAtA[i] = 0xa + i++ + i = encodeVarintPublic(dAtA, i, uint64(m.Pair.Size())) + n7, err := m.Pair.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n7 + } + if len(m.Field) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPublic(dAtA, i, uint64(len(m.Field))) + i += copy(dAtA[i:], m.Field) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + +func (m *PairsField) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PairsField) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Pairs) > 0 { + for _, msg := range m.Pairs { + dAtA[i] = 0xa + i++ + i = encodeVarintPublic(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.Field) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintPublic(dAtA, i, uint64(len(m.Field))) + i += copy(dAtA[i:], m.Field) + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } + return i, nil +} + func (m *FieldRow) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1912,21 +2108,21 @@ func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], m.Query) } if len(m.Shards) > 0 { - dAtA8 := make([]byte, len(m.Shards)*10) - var j7 int + dAtA9 := make([]byte, len(m.Shards)*10) + var j8 int for _, num := range m.Shards { for num >= 1<<7 { - dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) + dAtA9[j8] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j7++ + j8++ } - dAtA8[j7] = uint8(num) - j7++ + dAtA9[j8] = uint8(num) + j8++ } dAtA[i] = 0x12 i++ - i = encodeVarintPublic(dAtA, i, uint64(j7)) - i += copy(dAtA[i:], dAtA8[:j7]) + i = encodeVarintPublic(dAtA, i, uint64(j8)) + i += copy(dAtA[i:], dAtA9[:j8]) } if m.ColumnAttrs { dAtA[i] = 0x18 @@ -2056,11 +2252,11 @@ func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintPublic(dAtA, i, uint64(m.Row.Size())) - n9, err := m.Row.MarshalTo(dAtA[i:]) + n10, err := m.Row.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n10 } if m.N != 0 { dAtA[i] = 0x10 @@ -2093,11 +2289,11 @@ func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x2a i++ i = encodeVarintPublic(dAtA, i, uint64(m.ValCount.Size())) - n10, err := m.ValCount.MarshalTo(dAtA[i:]) + n11, err := m.ValCount.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n10 + i += n11 } if m.Type != 0 { dAtA[i] = 0x30 @@ -2105,21 +2301,21 @@ func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPublic(dAtA, i, uint64(m.Type)) } if len(m.RowIDs) > 0 { - dAtA12 := make([]byte, len(m.RowIDs)*10) - var j11 int + dAtA13 := make([]byte, len(m.RowIDs)*10) + var j12 int for _, num := range m.RowIDs { for num >= 1<<7 { - dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j11++ + j12++ } - dAtA12[j11] = uint8(num) - j11++ + dAtA13[j12] = uint8(num) + j12++ } dAtA[i] = 0x3a i++ - i = encodeVarintPublic(dAtA, i, uint64(j11)) - i += copy(dAtA[i:], dAtA12[:j11]) + i = encodeVarintPublic(dAtA, i, uint64(j12)) + i += copy(dAtA[i:], dAtA13[:j12]) } if len(m.GroupCounts) > 0 { for _, msg := range m.GroupCounts { @@ -2137,21 +2333,31 @@ func (m *QueryResult) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0x4a i++ i = encodeVarintPublic(dAtA, i, uint64(m.RowIdentifiers.Size())) - n13, err := m.RowIdentifiers.MarshalTo(dAtA[i:]) + n14, err := m.RowIdentifiers.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n13 + i += n14 } if m.SignedRow != nil { dAtA[i] = 0x52 i++ i = encodeVarintPublic(dAtA, i, uint64(m.SignedRow.Size())) - n14, err := m.SignedRow.MarshalTo(dAtA[i:]) + n15, err := m.SignedRow.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n14 + i += n15 + } + if m.PairsField != nil { + dAtA[i] = 0x5a + i++ + i = encodeVarintPublic(dAtA, i, uint64(m.PairsField.Size())) + n16, err := m.PairsField.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n16 } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2192,26 +2398,9 @@ func (m *ImportRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPublic(dAtA, i, uint64(m.Shard)) } if len(m.RowIDs) > 0 { - dAtA16 := make([]byte, len(m.RowIDs)*10) - var j15 int - for _, num := range m.RowIDs { - for num >= 1<<7 { - dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j15++ - } - dAtA16[j15] = uint8(num) - j15++ - } - dAtA[i] = 0x22 - i++ - i = encodeVarintPublic(dAtA, i, uint64(j15)) - i += copy(dAtA[i:], dAtA16[:j15]) - } - if len(m.ColumnIDs) > 0 { - dAtA18 := make([]byte, len(m.ColumnIDs)*10) + dAtA18 := make([]byte, len(m.RowIDs)*10) var j17 int - for _, num := range m.ColumnIDs { + for _, num := range m.RowIDs { for num >= 1<<7 { dAtA18[j17] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -2220,16 +2409,15 @@ func (m *ImportRequest) MarshalTo(dAtA []byte) (int, error) { dAtA18[j17] = uint8(num) j17++ } - dAtA[i] = 0x2a + dAtA[i] = 0x22 i++ i = encodeVarintPublic(dAtA, i, uint64(j17)) i += copy(dAtA[i:], dAtA18[:j17]) } - if len(m.Timestamps) > 0 { - dAtA20 := make([]byte, len(m.Timestamps)*10) + if len(m.ColumnIDs) > 0 { + dAtA20 := make([]byte, len(m.ColumnIDs)*10) var j19 int - for _, num1 := range m.Timestamps { - num := uint64(num1) + for _, num := range m.ColumnIDs { for num >= 1<<7 { dAtA20[j19] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -2238,11 +2426,29 @@ func (m *ImportRequest) MarshalTo(dAtA []byte) (int, error) { dAtA20[j19] = uint8(num) j19++ } - dAtA[i] = 0x32 + dAtA[i] = 0x2a i++ i = encodeVarintPublic(dAtA, i, uint64(j19)) i += copy(dAtA[i:], dAtA20[:j19]) } + if len(m.Timestamps) > 0 { + dAtA22 := make([]byte, len(m.Timestamps)*10) + var j21 int + for _, num1 := range m.Timestamps { + num := uint64(num1) + for num >= 1<<7 { + dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j21++ + } + dAtA22[j21] = uint8(num) + j21++ + } + dAtA[i] = 0x32 + i++ + i = encodeVarintPublic(dAtA, i, uint64(j21)) + i += copy(dAtA[i:], dAtA22[:j21]) + } if len(m.RowKeys) > 0 { for _, s := range m.RowKeys { dAtA[i] = 0x3a @@ -2312,27 +2518,9 @@ func (m *ImportValueRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintPublic(dAtA, i, uint64(m.Shard)) } if len(m.ColumnIDs) > 0 { - dAtA22 := make([]byte, len(m.ColumnIDs)*10) - var j21 int - for _, num := range m.ColumnIDs { - for num >= 1<<7 { - dAtA22[j21] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j21++ - } - dAtA22[j21] = uint8(num) - j21++ - } - dAtA[i] = 0x2a - i++ - i = encodeVarintPublic(dAtA, i, uint64(j21)) - i += copy(dAtA[i:], dAtA22[:j21]) - } - if len(m.Values) > 0 { - dAtA24 := make([]byte, len(m.Values)*10) + dAtA24 := make([]byte, len(m.ColumnIDs)*10) var j23 int - for _, num1 := range m.Values { - num := uint64(num1) + for _, num := range m.ColumnIDs { for num >= 1<<7 { dAtA24[j23] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 @@ -2341,11 +2529,29 @@ func (m *ImportValueRequest) MarshalTo(dAtA []byte) (int, error) { dAtA24[j23] = uint8(num) j23++ } - dAtA[i] = 0x32 + dAtA[i] = 0x2a i++ i = encodeVarintPublic(dAtA, i, uint64(j23)) i += copy(dAtA[i:], dAtA24[:j23]) } + if len(m.Values) > 0 { + dAtA26 := make([]byte, len(m.Values)*10) + var j25 int + for _, num1 := range m.Values { + num := uint64(num1) + for num >= 1<<7 { + dAtA26[j25] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j25++ + } + dAtA26[j25] = uint8(num) + j25++ + } + dAtA[i] = 0x32 + i++ + i = encodeVarintPublic(dAtA, i, uint64(j25)) + i += copy(dAtA[i:], dAtA26[:j25]) + } if len(m.ColumnKeys) > 0 { for _, s := range m.ColumnKeys { dAtA[i] = 0x3a @@ -2366,8 +2572,8 @@ func (m *ImportValueRequest) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintPublic(dAtA, i, uint64(len(m.FloatValues)*8)) for _, num := range m.FloatValues { - f25 := math.Float64bits(float64(num)) - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f25)) + f27 := math.Float64bits(float64(num)) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f27)) i += 8 } } @@ -2441,21 +2647,21 @@ func (m *TranslateKeysResponse) MarshalTo(dAtA []byte) (int, error) { var l int _ = l if len(m.IDs) > 0 { - dAtA27 := make([]byte, len(m.IDs)*10) - var j26 int + dAtA29 := make([]byte, len(m.IDs)*10) + var j28 int for _, num := range m.IDs { for num >= 1<<7 { - dAtA27[j26] = uint8(uint64(num)&0x7f | 0x80) + dAtA29[j28] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j26++ + j28++ } - dAtA27[j26] = uint8(num) - j26++ + dAtA29[j28] = uint8(num) + j28++ } dAtA[i] = 0x1a i++ - i = encodeVarintPublic(dAtA, i, uint64(j26)) - i += copy(dAtA[i:], dAtA27[:j26]) + i = encodeVarintPublic(dAtA, i, uint64(j28)) + i += copy(dAtA[i:], dAtA29[:j28]) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2587,21 +2793,21 @@ func (m *ImportColumnAttrsRequest) MarshalTo(dAtA []byte) (int, error) { } } if len(m.ColumnIDs) > 0 { - dAtA29 := make([]byte, len(m.ColumnIDs)*10) - var j28 int + dAtA31 := make([]byte, len(m.ColumnIDs)*10) + var j30 int for _, num := range m.ColumnIDs { for num >= 1<<7 { - dAtA29[j28] = uint8(uint64(num)&0x7f | 0x80) + dAtA31[j30] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j28++ + j30++ } - dAtA29[j28] = uint8(num) - j28++ + dAtA31[j30] = uint8(num) + j30++ } dAtA[i] = 0x2a i++ - i = encodeVarintPublic(dAtA, i, uint64(j28)) - i += copy(dAtA[i:], dAtA29[:j28]) + i = encodeVarintPublic(dAtA, i, uint64(j30)) + i += copy(dAtA[i:], dAtA31[:j30]) } if m.XXX_unrecognized != nil { i += copy(dAtA[i:], m.XXX_unrecognized) @@ -2720,6 +2926,48 @@ func (m *Pair) Size() (n int) { return n } +func (m *PairField) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pair != nil { + l = m.Pair.Size() + n += 1 + l + sovPublic(uint64(l)) + } + l = len(m.Field) + if l > 0 { + n += 1 + l + sovPublic(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *PairsField) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovPublic(uint64(l)) + } + } + l = len(m.Field) + if l > 0 { + n += 1 + l + sovPublic(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *FieldRow) Size() (n int) { if m == nil { return 0 @@ -2979,6 +3227,10 @@ func (m *QueryResult) Size() (n int) { l = m.SignedRow.Size() n += 1 + l + sovPublic(uint64(l)) } + if m.PairsField != nil { + l = m.PairsField.Size() + n += 1 + l + sovPublic(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3825,6 +4077,230 @@ func (m *Pair) Unmarshal(dAtA []byte) error { } return nil } +func (m *PairField) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PairField: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PairField: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPublic + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pair == nil { + m.Pair = &Pair{} + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPublic + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPublic(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPublic + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PairsField) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PairsField: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PairsField: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPublic + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, &Pair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthPublic + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipPublic(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthPublic + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *FieldRow) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5312,6 +5788,39 @@ func (m *QueryResult) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PairsField", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowPublic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthPublic + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PairsField == nil { + m.PairsField = &PairsField{} + } + if err := m.PairsField.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipPublic(dAtA[iNdEx:]) @@ -6903,72 +7412,75 @@ var ( ErrIntOverflowPublic = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("public.proto", fileDescriptor_public_568b1fcbeadcdcca) } +func init() { proto.RegisterFile("public.proto", fileDescriptor_public_48374b395a722341) } -var fileDescriptor_public_568b1fcbeadcdcca = []byte{ - // 1016 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0x1b, 0x45, - 0x14, 0x66, 0xbc, 0xeb, 0x78, 0x7d, 0x9c, 0x84, 0x6a, 0x48, 0xcb, 0x0a, 0x55, 0xc1, 0x1a, 0x21, - 0xb4, 0xdc, 0xa4, 0x6a, 0x90, 0x50, 0xaf, 0xf8, 0x49, 0x93, 0x22, 0xab, 0xaa, 0x55, 0x8e, 0x23, - 0x73, 0x87, 0xb4, 0xa9, 0xa7, 0xee, 0x4a, 0xeb, 0x1d, 0xb3, 0x3f, 0x6c, 0xf3, 0x00, 0x3c, 0x01, - 0x37, 0x88, 0x27, 0xe0, 0x51, 0xb8, 0x42, 0x3c, 0x02, 0x84, 0xc7, 0xe0, 0x06, 0xcd, 0x99, 0x1d, - 0xcf, 0x7a, 0x9b, 0x04, 0x84, 0xb8, 0x3b, 0xdf, 0x39, 0x33, 0x67, 0xce, 0x37, 0xe7, 0x67, 0x06, - 0x76, 0xd7, 0xd5, 0x45, 0x9a, 0xbc, 0x38, 0x5a, 0xe7, 0xaa, 0x54, 0x3c, 0x48, 0xb2, 0x52, 0xe6, - 0x59, 0x9c, 0x8a, 0x02, 0x3c, 0x54, 0x35, 0x0f, 0x61, 0xf0, 0x58, 0xa5, 0xd5, 0x2a, 0x2b, 0x42, - 0x36, 0xf6, 0x22, 0x1f, 0x2d, 0xe4, 0x1f, 0x40, 0xff, 0x8b, 0xb2, 0xcc, 0x8b, 0xb0, 0x37, 0xf6, - 0xa2, 0xd1, 0xf1, 0xfe, 0x91, 0xdd, 0x7a, 0xa4, 0xd5, 0x68, 0x8c, 0x9c, 0x83, 0xff, 0x54, 0x5e, - 0x16, 0xa1, 0x37, 0xf6, 0xa2,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, 0x9e, 0xc8, 0x5a, 0xbb, 0x9e, - 0xc6, 0x2b, 0xd9, 0x44, 0x41, 0xb2, 0xd6, 0xd1, 0xc0, 0xea, 0xd1, 0xe7, 0x83, 0x64, 0xf1, 0x12, - 0x0e, 0xae, 0xf3, 0x41, 0x4f, 0x5f, 0x2a, 0x63, 0x33, 0xa1, 0x02, 0x34, 0x80, 0x3f, 0x82, 0xfe, - 0x77, 0x89, 0xac, 0xed, 0x84, 0x12, 0xae, 0xb0, 0x6f, 0x0a, 0x04, 0xcd, 0x06, 0xf1, 0x13, 0xb3, - 0xc1, 0xb6, 0x86, 0xf6, 0x3f, 0xde, 0x99, 0xc9, 0x77, 0xf3, 0xfa, 0x9a, 0x7c, 0x87, 0xe6, 0xe5, - 0x71, 0x4f, 0xa7, 0x85, 0xfa, 0xb5, 0xd3, 0xe2, 0x3c, 0x4e, 0x4d, 0xd1, 0x0f, 0x71, 0x83, 0x6f, - 0xaf, 0x92, 0x93, 0x3b, 0xbf, 0x5c, 0x1d, 0xb2, 0xdf, 0xae, 0x0e, 0xd9, 0xef, 0x57, 0x87, 0xec, - 0xc7, 0x3f, 0x0f, 0xdf, 0xba, 0xd8, 0xa1, 0x6f, 0xe1, 0xc7, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, - 0x9d, 0x83, 0xa0, 0x41, 0x26, 0x0a, 0x00, 0x00, +var fileDescriptor_public_48374b395a722341 = []byte{ + // 1065 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdb, 0x6e, 0x1c, 0x45, + 0x13, 0xfe, 0x7b, 0x67, 0xd6, 0xbb, 0x5b, 0x6b, 0xfb, 0x8f, 0x9a, 0x4d, 0x18, 0xa1, 0xc8, 0xac, + 0x5a, 0x11, 0x1a, 0x6e, 0x1c, 0xc5, 0x20, 0x94, 0x2b, 0x0e, 0x8e, 0x1d, 0x58, 0x45, 0x59, 0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, 0xcf, 0xea, + 0x15, 0x8c, 0xae, 0x8b, 0xc1, 0x0f, 0x66, 0xa2, 0x23, 0xc3, 0x6b, 0x7d, 0x34, 0x40, 0x3e, 0x86, + 0xee, 0xb7, 0xb1, 0xae, 0x2d, 0xaf, 0x29, 0x37, 0xda, 0x37, 0x25, 0x82, 0xc6, 0x41, 0xfd, 0x20, + 0x6c, 0xb2, 0x2d, 0xaa, 0xff, 0xdb, 0x9e, 0x99, 0xfb, 0x6e, 0xde, 0x6c, 0x73, 0xdf, 0x81, 0x79, + 0xaf, 0xdc, 0x83, 0x6b, 0x21, 0xbd, 0x91, 0x74, 0x9c, 0x45, 0x89, 0x19, 0xfa, 0x01, 0xae, 0xf0, + 0xed, 0x53, 0x72, 0x78, 0xe7, 0xe7, 0xcb, 0x3d, 0xf1, 0xeb, 0xe5, 0x9e, 0xf8, 0xed, 0x72, 0x4f, + 0x7c, 0xff, 0xc7, 0xde, 0xff, 0xce, 0xb6, 0xf8, 0xef, 0xf6, 0x83, 0xbf, 0x02, 0x00, 0x00, 0xff, + 0xff, 0xdd, 0x9e, 0xfe, 0xf7, 0xed, 0x0a, 0x00, 0x00, } diff --git a/internal/public.proto b/internal/public.proto index b8d569f85..a58c75e96 100644 --- a/internal/public.proto +++ b/internal/public.proto @@ -25,6 +25,16 @@ message Pair { uint64 Count = 2; } +message PairField { + Pair Pair = 1; + string Field = 2; +} + +message PairsField { + repeated Pair Pairs = 1; + string Field = 2; +} + message FieldRow{ string Field = 1; uint64 RowID = 2; @@ -88,6 +98,7 @@ message QueryResult { repeated GroupCount GroupCounts = 8; RowIdentifiers RowIdentifiers = 9; SignedRow SignedRow = 10; + PairsField PairsField = 11; } message ImportRequest { @@ -137,4 +148,4 @@ message ImportColumnAttrsRequest { string AttrKey = 3; repeated string AttrVals = 4; repeated uint64 ColumnIDs = 5; -} \ No newline at end of file +} diff --git a/server/grpc.go b/server/grpc.go index c27527af0..81060b6a3 100644 --- a/server/grpc.go +++ b/server/grpc.go @@ -433,35 +433,35 @@ func makeRows(resp pilosa.QueryResponse, logger logger.Logger) chan *pb.RowRespo } */ } - case pilosa.Pair: - if r.Key != "" { + case pilosa.PairField: + if r.Pair.Key != "" { results <- &pb.RowResponse{ Headers: []*pb.ColumnInfo{ - {Name: "_id", Datatype: "string"}, + {Name: r.Field, Datatype: "string"}, {Name: "count", Datatype: "uint64"}, }, Columns: []*pb.ColumnResponse{ - &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_StringVal{StringVal: r.Key}}, - &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.Count}}, + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_StringVal{StringVal: r.Pair.Key}}, + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.Pair.Count}}, }, } } else { results <- &pb.RowResponse{ Headers: []*pb.ColumnInfo{ - {Name: "_id", Datatype: "uint64"}, + {Name: r.Field, Datatype: "uint64"}, {Name: "count", Datatype: "uint64"}, }, Columns: []*pb.ColumnResponse{ - &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.ID}}, - &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.Count}}, + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.Pair.ID}}, + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Uint64Val{Uint64Val: r.Pair.Count}}, }, } } - case []pilosa.Pair: + case *pilosa.PairsField: // Determine if the ID has string keys. var stringKeys bool - if len(r) > 0 { - if r[0].Key != "" { + if len(r.Pairs) > 0 { + if r.Pairs[0].Key != "" { stringKeys = true } } @@ -471,10 +471,10 @@ func makeRows(resp pilosa.QueryResponse, logger logger.Logger) chan *pb.RowRespo dtype = "string" } ci := []*pb.ColumnInfo{ - {Name: "_id", Datatype: dtype}, + {Name: r.Field, Datatype: dtype}, {Name: "count", Datatype: "uint64"}, } - for _, pair := range r { + for _, pair := range r.Pairs { if stringKeys { results <- &pb.RowResponse{ Headers: ci, @@ -528,7 +528,7 @@ func makeRows(resp pilosa.QueryResponse, logger logger.Logger) chan *pb.RowRespo } case pilosa.RowIdentifiers: if len(r.Keys) > 0 { - ci := []*pb.ColumnInfo{{Name: "_id", Datatype: "string"}} + ci := []*pb.ColumnInfo{{Name: r.Field(), Datatype: "string"}} for _, key := range r.Keys { results <- &pb.RowResponse{ Headers: ci, @@ -538,7 +538,7 @@ func makeRows(resp pilosa.QueryResponse, logger logger.Logger) chan *pb.RowRespo ci = nil } } else { - ci := []*pb.ColumnInfo{{Name: "_id", Datatype: "uint64"}} + ci := []*pb.ColumnInfo{{Name: r.Field(), Datatype: "uint64"}} for _, id := range r.Rows { results <- &pb.RowResponse{ Headers: ci, diff --git a/server/grpc_internal_test.go b/server/grpc_internal_test.go index 285f35eb1..c0701be3e 100644 --- a/server/grpc_internal_test.go +++ b/server/grpc_internal_test.go @@ -175,7 +175,7 @@ func TestGRPC(t *testing.T) { Rows: []uint64{10, 11, 12}, }, []expHeader{ - {"_id", "uint64"}, + {"", "uint64"}, // This is blank because we don't expose RowIdentifiers.field, so we have no way to set it for tests. }, [][]expColumn{ {uint64(10)}, @@ -189,7 +189,7 @@ func TestGRPC(t *testing.T) { Keys: []string{"ten", "eleven", "twelve"}, }, []expHeader{ - {"_id", "string"}, + {"", "string"}, // This is blank because we don't expose RowIdentifiers.field, so we have no way to set it for tests. }, [][]expColumn{ {"ten"}, diff --git a/server/handler_test.go b/server/handler_test.go index c67d98657..2f0af0345 100644 --- a/server/handler_test.go +++ b/server/handler_test.go @@ -224,7 +224,12 @@ func TestHandler_Endpoints(t *testing.T) { if err != nil { t.Fatalf("querying: %v", err) } - if !reflect.DeepEqual(resp.Results[0], []pilosa.Pair{{Count: 12, ID: 0}}) { + if !reflect.DeepEqual(resp.Results[0], &pilosa.PairsField{ + Pairs: []pilosa.Pair{ + {Count: 12, ID: 0}, + }, + Field: "f1", + }) { t.Fatalf("Unexpected result %v", resp.Results[0]) } @@ -504,8 +509,8 @@ func TestHandler_Endpoints(t *testing.T) { var resp pilosa.QueryResponse if err := cmd.API.Serializer.Unmarshal(w.Body.Bytes(), &resp); err != nil { t.Fatal(err) - } else if a := resp.Results[0].([]pilosa.Pair); len(a) != 2 { - t.Fatalf("unexpected pair length: %d", len(a)) + } else if a := resp.Results[0].(*pilosa.PairsField); len(a.Pairs) != 2 { + t.Fatalf("unexpected pair length: %d", len(a.Pairs)) } }) From 3b7b54094a0799080ef5f980a76efa9a0991cf72 Mon Sep 17 00:00:00 2001 From: Travis Date: Fri, 13 Dec 2019 18:45:43 -0600 Subject: [PATCH 2/3] update clustertests to use v2 (and go 1.13) --- Dockerfile-clustertests | 2 +- internal/clustertests/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile-clustertests b/Dockerfile-clustertests index 53621b9ab..69fbd9a54 100644 --- a/Dockerfile-clustertests +++ b/Dockerfile-clustertests @@ -1,7 +1,7 @@ # This Dockerfile is used for cluster testing - it produces a much larger image # and includes all of Go as well as some utilities. -FROM golang:1.11 +FROM golang:1.13 LABEL maintainer "dev@pilosa.com" diff --git a/internal/clustertests/docker-compose.yml b/internal/clustertests/docker-compose.yml index 94a96ad5a..1546a5b13 100644 --- a/internal/clustertests/docker-compose.yml +++ b/internal/clustertests/docker-compose.yml @@ -51,6 +51,6 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock command: - - "cd /go/src/github.com/pilosa/pilosa/ && go test -v -count=1 github.com/pilosa/pilosa/internal/clustertests" + - "cd /go/src/github.com/pilosa/pilosa/ && go test -v -count=1 github.com/pilosa/pilosa/v2/internal/clustertests" networks: pilosanet: From 4f7f4f58b1193040e0586daec9eccb2a99a5d3ab Mon Sep 17 00:00:00 2001 From: Travis Date: Sat, 14 Dec 2019 15:56:06 -0600 Subject: [PATCH 3/3] add field to SignedRow, and implement its grpc response --- executor.go | 16 ++++++++++++---- server/grpc.go | 21 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/executor.go b/executor.go index 72c6da626..25dfbf4c1 100644 --- a/executor.go +++ b/executor.go @@ -694,7 +694,8 @@ func (e *executor) executeGenericField(ctx context.Context, index string, c *pql span.LogKV("name", c.Name) defer span.Finish() - if field := c.Args["field"]; field == "" { + field := c.Args["field"] + if field == "" { return SignedRow{}, fmt.Errorf("plugin operation %s(): field required", c.Name) } @@ -714,6 +715,7 @@ func (e *executor) executeGenericField(ctx context.Context, index string, c *pql return SignedRow{}, err } other, _ := result.(SignedRow) + other.field = field.(string) return other, nil } @@ -3776,12 +3778,18 @@ func needsShards(calls []*pql.Call) bool { // SignedRow represents a signed *Row with two (neg/pos) *Rows. type SignedRow struct { - Neg *Row `json:"neg"` - Pos *Row `json:"pos"` + Neg *Row `json:"neg"` + Pos *Row `json:"pos"` + field string +} + +// Field returns the field name associated to the signed row. +func (s *SignedRow) Field() string { + return s.field } func (sr *SignedRow) union(other SignedRow) SignedRow { - ret := SignedRow{&Row{}, &Row{}} + ret := SignedRow{&Row{}, &Row{}, ""} // merge in sr if sr != nil { diff --git a/server/grpc.go b/server/grpc.go index 81060b6a3..cb1856b9f 100644 --- a/server/grpc.go +++ b/server/grpc.go @@ -573,6 +573,27 @@ func makeRows(resp pilosa.QueryResponse, logger logger.Logger) chan *pb.RowRespo &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: r.Val}}, &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: r.Count}}, }} + case pilosa.SignedRow: + // TODO: address the overflow issue with values outside the int64 range + ci := []*pb.ColumnInfo{{Name: r.Field(), Datatype: "int64"}} + negs := r.Neg.Columns() + for i := len(negs) - 1; i >= 0; i-- { + results <- &pb.RowResponse{ + Headers: ci, + Columns: []*pb.ColumnResponse{ + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: -1 * int64(negs[i])}}, + }} + ci = nil + } + for _, id := range r.Pos.Columns() { + results <- &pb.RowResponse{ + Headers: ci, + Columns: []*pb.ColumnResponse{ + &pb.ColumnResponse{ColumnVal: &pb.ColumnResponse_Int64Val{Int64Val: int64(id)}}, + }} + ci = nil + } + default: logger.Printf("unhandled %T\n", r) breakLoop = true