From 2ecea00515e225c8e50c6a827dee797951605b2d Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Sun, 19 Feb 2017 21:09:12 +0300 Subject: [PATCH 01/10] updated README to have TopN(frame=bar) variant --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2079010ec..a3bfb35dc 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,11 @@ Range(id=10, frame="foo", start="1970-01-01T00:00", end="2000-01-02T03:04") --- #### TopN() +``` +TopN(frame="bar") +``` +Returns all Bitmaps in the cache from frame `bar` sorted by the count of bits. + ``` TopN(frame="bar", n=20) ``` @@ -206,11 +211,9 @@ TopN(Bitmap(id=10, frame="foo"), frame="bar", n=20) ``` Returns the top 20 Bitmaps from `bar` sorted by the count of bits in the intersection with `Bitmap(id=10)`. - ``` TopN(Bitmap(id=10, frame="foo"), frame="bar", n=20, field="category", [81,82]) ``` - Returns the top 20 Bitmaps from `bar`in attribute `category` with values `81 or 82` sorted by the count of bits in the intersection with `Bitmap(id=10)`. From 43868a971ef9915bc95a7ee6eda16980685cff6c Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Mon, 6 Mar 2017 23:53:52 +0300 Subject: [PATCH 02/10] updated readme for row col schema --- README.md | 81 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 190fc571b..f7b43538d 100644 --- a/README.md +++ b/README.md @@ -96,22 +96,55 @@ Return a list of all databases and frames in the index: $ curl "http://127.0.0.1:15000/schema" ``` +### Database and Frame Schema + +Before running a query, the corresponding database and frame must be created. Note that database and frame names can contain only lower case letters, numbers, dash (`-`), underscore (`_`) and dot (`.`). + +You can create the database `sample-db` using: + +```sh +$ curl -XPOST "http://127.0.0.1:15000/db" \ + -d '{"db": "sample-db"}' +``` + +Optionally, you can specify the column label on database creation: + +```sh +$ curl -XPOST "http://127.0.0.1:15000/db" \ + -d '{"db": "sample-db", "columnLabel": "user"}' +``` + +The frame `collaboration` may be created using the following call: + +```sh +$ curl -XPOST "http://127.0.0.1:15000/frame" \ + -d '{"db": "sample-db", "frame": "collaboration"}' +``` + +It is possible to specify the frame row label on frame creation: + +```sh +$ curl -XPOST "http://127.0.0.1:15000/frame" \ + -d '{"db": "sample-db", "frame": "collaboration"}, "options": {"rowLabel": "project"}}' +``` ### Queries Queries to Pilosa require sending a POST request where the query itself is sent as POST data. You specify the database on which to perform the query with a URL argument `db=database-name`. -A query sent to database `exampleDB` will have the following format: +In this section, we assume both the database `sample-db` with column label `user` and the frame `collaboration` with row label `project` was created. + +A query sent to database `sample-db` will have the following format: ```sh -$ curl -X POST "http://127.0.0.1:15000/query?db=exampleDB" -d 'Query()' +$ curl -X POST "http://127.0.0.1:15000/query?db=sample-db" -d 'Query()' ``` The `Query()` object referenced above should be made up of one or more of the query types listed below. So for example, a SetBit() query would look like this: ```sh -$ curl -X POST "http://127.0.0.1:15000/query?db=exampleDB" -d 'SetBit(id=10, frame="foo", profileID=1)' +$ curl -X POST "http://127.0.0.1:15000/query?db=sample-db" -d 'SetBit(project=10, frame="collaboration", user=1)' ``` Query results have the format `{"results":[]}`, where `results` is a list of results for each `Query()`. This @@ -119,26 +152,26 @@ means that you can provide multiple `Query()` objects with each HTTP request and the results of all of the queries. ```sh -$ curl -X POST "http://127.0.0.1:15000/query?db=exampleDB" -d 'Query() Query() Query()' +$ curl -X POST "http://127.0.0.1:15000/query?db=sample-db" -d 'Query() Query() Query()' ``` --- #### SetBit() ``` -SetBit(id=10, frame="foo", profileID=1) +SetBit(project=10, frame="collaboration", user=1) ``` A return value of `{"results":[true]}` indicates that the bit was toggled from 0 to 1. A return value of `{"results":[false]}` indicates that the bit was already set to 1 and therefore nothing changed. SetBit accepts an optional `timestamp` field: ``` -SetBit(id=10, frame=f, profileID=2, timestamp="2016-12-11T10:09:07") +SetBit(project=10, frame="collaboration", user=2, timestamp="2016-12-11T10:09:07") ``` --- #### ClearBit() ``` -ClearBit(id=10, frame="foo", profileID=1) +ClearBit(project=10, frame="collaboration", user=1) ``` A return value of `{"results":[true]}` indicates that the bit was toggled from 1 to 0. A return value of `{"results":[false]}` indicates that the bit was already set to 0 and therefore nothing changed. @@ -146,7 +179,7 @@ A return value of `{"results":[false]}` indicates that the bit was already set t --- #### SetBitmapAttrs() ``` -SetBitmapAttrs(id=10, frame="foo", category=123, color="blue", happy=true) +SetBitmapAttrs(project=10, frame="collaboration", stars=123, url="http://projects.pilosa.com/10", active=true) ``` Returns `{"results":[null]}` @@ -154,7 +187,7 @@ Returns `{"results":[null]}` #### SetProfileAttrs() --- ``` -SetProfileAttrs(id=10, category=123, color="blue", happy=true) +SetProfileAttrs(user=10, friends=123, username="mrpi", active=true) ``` Returns `{"results":[null]}` @@ -162,20 +195,20 @@ Returns `{"results":[null]}` --- #### Bitmap() ``` -Bitmap(id=10, frame="foo") +Bitmap(project=10, frame="collaboration") ``` -Returns `{"results":[{"attrs":{"category":123,"color":"blue","happy":true},"bits":[1,2]}]}` where `attrs` are the +Returns `{"results":[{"attrs":{"stars":123, "url":"http://projects.pilosa.com/10", "active":true},"bits":[1,2]}]}` where `attrs` are the attributes set using `SetBitmapAttrs()` and `bits` are the bits set using `SetBit()`. In order to return profile attributes attached to the profiles of a bitmap, add `&profiles=true` to the query string. Sample response: ``` -{"results":[{"attrs":{},"bits":[10]}],"profiles":[{"id":10,"attrs":{"category":123,"color":"blue","happy":true}}]} +{"results":[{"attrs":{},"bits":[10]}],"profiles":[{"user":10,"attrs":{"friends":123, "username":"mrpi", "active":true}}]} ``` --- #### Union() ``` -Union(Bitmap(id=10, frame="foo"), Bitmap(id=20, frame="foo"))) +Union(Bitmap(project=10, frame="collaboration"), Bitmap(project=20, frame="collaboration"))) ``` Returns a result set similar to that of a `Bitmap()` query, only the `attrs` dictionary will be empty: `{"results":[{"attrs":{},"bits":[1,2]}]}`. Note that a `Union()` query can be nested within other queries anywhere that you would otherwise provide a `Bitmap()`. @@ -183,7 +216,7 @@ Note that a `Union()` query can be nested within other queries anywhere that you --- #### Intersect() ``` -Intersect(Bitmap(id=10, frame="foo"), Bitmap(id=20, frame="foo"))) +Intersect(Bitmap(project=10, frame="collaboration"), Bitmap(project=20, frame="collaboration"))) ``` Returns a result set similar to that of a `Bitmap()` query, only the `attrs` dictionary will be empty: `{"results":[{"attrs":{},"bits":[1]}]}`. Note that an `Intersect()` query can be nested within other queries anywhere that you would otherwise provide a `Bitmap()`. @@ -191,7 +224,7 @@ Note that an `Intersect()` query can be nested within other queries anywhere tha --- #### Difference() ``` -Difference(Bitmap(id=10, frame="foo"), Bitmap(id=20, frame="foo"))) +Difference(Bitmap(project=10, frame="collaboration"), Bitmap(project=20, frame="collaboration"))) ``` `Difference()` represents all of the bits that are set in the first `Bitmap()` but are not set in the second `Bitmap()`. It returns a result set similar to that of a `Bitmap()` query, only the `attrs` dictionary will be empty: `{"results":[{"attrs":{},"bits":[2]}]}`. Note that a `Difference()` query can be nested within other queries anywhere that you would otherwise provide a `Bitmap()`. @@ -199,35 +232,35 @@ Note that a `Difference()` query can be nested within other queries anywhere tha --- #### Count() ``` -Count(Bitmap(id=10, frame="foo")) +Count(Bitmap(project=10, frame="collaboration")) ``` Returns the count of the number of bits set in `Bitmap()`: `{"results":[28]}` --- #### Range() ``` -Range(id=10, frame="foo", start="1970-01-01T00:00", end="2000-01-02T03:04") +Range(project=10, frame="collaboration", start="1970-01-01T00:00", end="2000-01-02T03:04") ``` --- #### TopN() ``` -TopN(frame="bar", n=20) +TopN(frame="geo", n=20) ``` -Returns the top 20 Bitmaps from frame `bar`. +Returns the top 20 Bitmaps from frame `geo`. ``` -TopN(Bitmap(id=10, frame="foo"), frame="bar", n=20) +TopN(Bitmap(project=10, frame="collaboration"), frame="geo", n=20) ``` -Returns the top 20 Bitmaps from `bar` sorted by the count of bits in the intersection with `Bitmap(id=10)`. +Returns the top 20 Bitmaps from `geo` sorted by the count of bits in the intersection with `Bitmap(project=10)`. ``` -TopN(Bitmap(id=10, frame="foo"), frame="bar", n=20, field="category", [81,82]) +TopN(Bitmap(project=10, frame="collaboration"), frame="geo", n=20, field="category", [81,82]) ``` -Returns the top 20 Bitmaps from `bar`in attribute `category` with values `81 or -82` sorted by the count of bits in the intersection with `Bitmap(id=10)`. +Returns the top 20 Bitmaps from `geo`in attribute `category` with values `81 or +82` sorted by the count of bits in the intersection with `Bitmap(project=10)`. ## Development From dbfc6052b738c9d7b9731d981586321a3c59990e Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Mon, 6 Mar 2017 16:28:59 -0600 Subject: [PATCH 03/10] add float support to scanner/parser for arguments --- pql/parser.go | 6 ++++++ pql/parser_test.go | 18 ++++++++++++++++++ pql/scanner.go | 10 ++++++++-- pql/scanner_test.go | 1 + pql/token.go | 1 + 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/pql/parser.go b/pql/parser.go index 0f1ff1e87..a5a72a0f7 100644 --- a/pql/parser.go +++ b/pql/parser.go @@ -174,6 +174,12 @@ func (p *Parser) parseArgs() (map[string]interface{}, error) { return nil, err } value = v + case FLOAT: + v, err := strconv.ParseFloat(lit, 64) + if err != nil { + return nil, err + } + value = v case LBRACK: v, err := p.parseList() if err != nil { diff --git a/pql/parser_test.go b/pql/parser_test.go index f4db973bc..23582594b 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -80,6 +80,24 @@ func TestParser_Parse(t *testing.T) { } }) + // Parse with float arguments. + t.Run("WithFloatArgs", func(t *testing.T) { + q, err := pql.ParseString(`MyCall( key=12.25, foo= 13.167)`) + if err != nil { + t.Fatal(err) + } else if !reflect.DeepEqual(q.Calls[0], + &pql.Call{ + Name: "MyCall", + Args: map[string]interface{}{ + "key": 12.25, + "foo": 13.167, + }, + }, + ) { + t.Fatalf("unexpected call: %#v", q.Calls[0]) + } + }) + // Parse with both child calls and arguments. t.Run("ChildrenAndArguments", func(t *testing.T) { q, err := pql.ParseString(`TopN(Bitmap(id=100, frame=other), frame=f, n=3)`) diff --git a/pql/scanner.go b/pql/scanner.go index 2b1add022..7cbbcc85b 100644 --- a/pql/scanner.go +++ b/pql/scanner.go @@ -143,17 +143,23 @@ func (s *Scanner) scanIdent() (tok Token, pos Pos, lit string) { // scanNumber consumes consecutive integer digits. func (s *Scanner) scanNumber() (tok Token, pos Pos, lit string) { pos = s.pos + tok = NUMBER var buf bytes.Buffer + var seenDot bool for { ch := s.read() - if !isDigit(ch) { + if !isDigit(ch) && (seenDot || ch != '.') { s.unread() break } + if ch == '.' { + seenDot = true + tok = FLOAT + } buf.WriteRune(ch) } - return NUMBER, pos, buf.String() + return tok, pos, buf.String() } // scanString consumes a single-quoted or double-quoted string. diff --git a/pql/scanner_test.go b/pql/scanner_test.go index 2f2112fe6..bc0cdd2f5 100644 --- a/pql/scanner_test.go +++ b/pql/scanner_test.go @@ -30,6 +30,7 @@ func TestScanner_Scan(t *testing.T) { {s: `foo`, tok: pql.IDENT, lit: `foo`}, {s: `100`, tok: pql.NUMBER, lit: `100`}, + {s: `100.3`, tok: pql.FLOAT, lit: `100.3`}, {s: `all`, tok: pql.ALL, lit: `all`}, {s: `ALL`, tok: pql.ALL, lit: `ALL`}, // case insensitive diff --git a/pql/token.go b/pql/token.go index f794a684a..af207e346 100644 --- a/pql/token.go +++ b/pql/token.go @@ -16,6 +16,7 @@ const ( STRING // "foo" BADSTRING // bad escape or unclosed string NUMBER // 12345 + FLOAT // 100.2 literal_end keyword_beg From f2707fad18751d8bf899df92ce24e343a7ba259a Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Mon, 6 Mar 2017 17:00:37 -0600 Subject: [PATCH 04/10] update tokens string map to include FLOAT --- pql/token.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pql/token.go b/pql/token.go index af207e346..2fd263119 100644 --- a/pql/token.go +++ b/pql/token.go @@ -38,6 +38,7 @@ var tokens = [...]string{ IDENT: "IDENT", NUMBER: "NUMBER", + FLOAT: "FLOAT", ALL: "ALL", From 0202c9b8490c1a581c0728f8d271616a67f1fbe2 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 7 Mar 2017 15:39:45 -0600 Subject: [PATCH 05/10] add float support to proto format floating point attrs are now fully supported --- .gitignore | 1 + Makefile | 13 +++- attr.go | 9 ++- internal/internal.pb.go | 131 ++++++++++++++++++++++++---------------- internal/internal.proto | 1 + pilosa.go | 9 ++- 6 files changed, 103 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index cd99c1b06..5fe629f6a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ default.etcd/ *.test vendor +.protoc-gen-gofast diff --git a/Makefile b/Makefile index f55fb8445..25d6bc6ad 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -.PHONY: glide vendor-update docker pilosa pilosactl crossbuild install +.PHONY: glide vendor-update docker pilosa pilosactl crossbuild install generate GLIDE := $(shell command -v glide 2>/dev/null) VERSION := $(shell git describe --tags) IDENTIFIER := $(VERSION)-$(GOOS)-$(GOARCH) +PROTOC := $(shell command -v protoc 2> /dev/null) CLONE_URL=github.com/pilosa/pilosa BUILD_TIME=`date -u +%FT%T%z` LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)" @@ -43,5 +44,15 @@ install: vendor go install $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosa go install $(LDFLAGS) $(FLAGS) $(CLONE_URL)/cmd/pilosactl +.protoc-gen-gofast: vendor +ifndef PROTOC + $(error "protoc is not available please install protoc from https://github.com/google/protobuf/releases") +endif + go build -o .protoc-gen-gofast ./vendor/github.com/gogo/protobuf/protoc-gen-gofast + cp ./.protoc-gen-gofast $(GOPATH)/bin/protoc-gen-gofast + +generate: .protoc-gen-gofast + go generate github.com/pilosa/pilosa/internal + docker: docker build -t pilosa:latest . diff --git a/attr.go b/attr.go index c85f77cad..6f031e839 100644 --- a/attr.go +++ b/attr.go @@ -22,6 +22,7 @@ const ( AttrTypeString = 1 AttrTypeUint = 2 AttrTypeBool = 3 + AttrTypeFloat = 4 ) // AttrStore represents a storage layer for attributes. @@ -269,7 +270,7 @@ func txUpdateAttrs(tx *bolt.Tx, id uint64, m map[string]interface{}) (map[string attr[k] = uint64(v) case int64: attr[k] = uint64(v) - case string, uint64, bool: + case string, uint64, bool, float64: attr[k] = v default: return nil, fmt.Errorf("invalid attr type: %T", v) @@ -318,8 +319,8 @@ func encodeAttr(key string, value interface{}) *internal.Attr { pb.Type = AttrTypeString pb.StringValue = value case float64: - pb.Type = AttrTypeUint - pb.UintValue = uint64(value) + pb.Type = AttrTypeFloat + pb.FloatValue = value case uint64: pb.Type = AttrTypeUint pb.UintValue = value @@ -342,6 +343,8 @@ func decodeAttr(attr *internal.Attr) (key string, value interface{}) { return attr.Key, attr.UintValue case AttrTypeBool: return attr.Key, attr.BoolValue + case AttrTypeFloat: + return attr.Key, attr.FloatValue default: return attr.Key, nil } diff --git a/internal/internal.pb.go b/internal/internal.pb.go index f0d8caac0..85f4102bd 100644 --- a/internal/internal.pb.go +++ b/internal/internal.pb.go @@ -122,11 +122,12 @@ func (m *Profile) GetAttrs() []*Attr { } type Attr struct { - Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` - Type uint64 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"` - StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3" json:"StringValue,omitempty"` - UintValue uint64 `protobuf:"varint,4,opt,name=UintValue,proto3" json:"UintValue,omitempty"` - BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3" json:"BoolValue,omitempty"` + Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` + Type uint64 `protobuf:"varint,2,opt,name=Type,proto3" json:"Type,omitempty"` + StringValue string `protobuf:"bytes,3,opt,name=StringValue,proto3" json:"StringValue,omitempty"` + UintValue uint64 `protobuf:"varint,4,opt,name=UintValue,proto3" json:"UintValue,omitempty"` + BoolValue bool `protobuf:"varint,5,opt,name=BoolValue,proto3" json:"BoolValue,omitempty"` + FloatValue float64 `protobuf:"fixed64,6,opt,name=FloatValue,proto3" json:"FloatValue,omitempty"` } func (m *Attr) Reset() { *m = Attr{} } @@ -554,6 +555,11 @@ func (m *Attr) MarshalTo(dAtA []byte) (int, error) { } i++ } + if m.FloatValue != 0 { + dAtA[i] = 0x31 + i++ + i = encodeFixed64Internal(dAtA, i, uint64(math.Float64bits(float64(m.FloatValue)))) + } return i, nil } @@ -1171,6 +1177,9 @@ func (m *Attr) Size() (n int) { if m.BoolValue { n += 2 } + if m.FloatValue != 0 { + n += 9 + } return n } @@ -2188,6 +2197,24 @@ func (m *Attr) Unmarshal(dAtA []byte) error { } } m.BoolValue = bool(v != 0) + case 6: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field FloatValue", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 8 + v = uint64(dAtA[iNdEx-8]) + v |= uint64(dAtA[iNdEx-7]) << 8 + v |= uint64(dAtA[iNdEx-6]) << 16 + v |= uint64(dAtA[iNdEx-5]) << 24 + v |= uint64(dAtA[iNdEx-4]) << 32 + v |= uint64(dAtA[iNdEx-3]) << 40 + v |= uint64(dAtA[iNdEx-2]) << 48 + v |= uint64(dAtA[iNdEx-1]) << 56 + m.FloatValue = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipInternal(dAtA[iNdEx:]) @@ -3911,51 +3938,51 @@ var ( func init() { proto.RegisterFile("internal.proto", fileDescriptorInternal) } var fileDescriptorInternal = []byte{ - // 721 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6a, 0x14, 0x4d, - 0x14, 0xfe, 0x6b, 0xba, 0x7b, 0x2e, 0x67, 0x92, 0x61, 0x52, 0xcc, 0xff, 0xd3, 0x84, 0x9f, 0x61, - 0x28, 0x14, 0x06, 0xc1, 0x04, 0xe2, 0x46, 0x44, 0x10, 0x7b, 0x66, 0x24, 0x83, 0x26, 0x24, 0x95, - 0xe8, 0xce, 0x45, 0x25, 0x29, 0x93, 0x26, 0x7d, 0x19, 0xab, 0xab, 0xd5, 0x59, 0xba, 0x70, 0xe3, - 0x13, 0x88, 0x3e, 0x81, 0x6f, 0xe2, 0xd2, 0x47, 0x90, 0xf8, 0x22, 0x52, 0x97, 0xbe, 0x44, 0x31, - 0x66, 0xe1, 0xae, 0xbf, 0xef, 0xd4, 0x39, 0xf5, 0x9d, 0x5b, 0x35, 0xf4, 0xc2, 0x44, 0x72, 0x91, - 0xb0, 0x68, 0x63, 0x21, 0x52, 0x99, 0xe2, 0x76, 0x81, 0xc9, 0x36, 0x34, 0xa6, 0x01, 0x1e, 0x41, - 0xf7, 0x30, 0x8c, 0xf9, 0x7e, 0xce, 0x12, 0x99, 0xc7, 0x3e, 0x1a, 0xa1, 0x71, 0x87, 0xd6, 0x29, - 0x75, 0x62, 0x92, 0x46, 0x79, 0x9c, 0x3c, 0x61, 0x47, 0x3c, 0xf2, 0x1b, 0xe6, 0x44, 0x8d, 0x22, - 0x33, 0xf0, 0x1e, 0x09, 0x16, 0xf3, 0x6b, 0x04, 0x5b, 0x87, 0x36, 0x4d, 0x5f, 0xd7, 0x23, 0x95, - 0x98, 0x04, 0xd0, 0x0c, 0x42, 0x19, 0xb3, 0x05, 0xc6, 0xe0, 0x06, 0xa1, 0xcc, 0x7c, 0x34, 0x72, - 0xc6, 0x2e, 0xd5, 0xdf, 0xf8, 0x06, 0x78, 0x0f, 0xa5, 0x14, 0x99, 0xdf, 0x18, 0x39, 0xe3, 0xee, - 0x56, 0x6f, 0xa3, 0x4c, 0x4c, 0xd1, 0xd4, 0x18, 0xc9, 0x06, 0xb8, 0x7b, 0x2c, 0x14, 0xb8, 0x0f, - 0xce, 0x63, 0xbe, 0xd4, 0x0a, 0x5c, 0xaa, 0x3e, 0xf1, 0x00, 0xbc, 0x49, 0x9a, 0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, 0x27, 0xd0, 0x0f, 0xa2, 0xf4, 0xf8, 0x7c, - 0xca, 0x24, 0xfb, 0x1b, 0x19, 0x0d, 0xc0, 0xd3, 0xf1, 0xec, 0xc6, 0x18, 0x40, 0xf6, 0x61, 0xad, - 0x76, 0x8b, 0x15, 0x73, 0x29, 0x79, 0x74, 0x75, 0xf2, 0x8d, 0x9f, 0x93, 0x27, 0x37, 0xc1, 0x9b, - 0xb0, 0xe3, 0xb3, 0x3f, 0x84, 0x21, 0x9f, 0x10, 0xac, 0xed, 0xb0, 0x37, 0x66, 0x2f, 0xca, 0xab, - 0xb7, 0xa1, 0x53, 0x92, 0x76, 0x31, 0x6f, 0x55, 0x93, 0xf0, 0xcb, 0xf9, 0x8a, 0x99, 0x25, 0x52, - 0x2c, 0x69, 0xe5, 0xbc, 0x7e, 0x1f, 0x7a, 0x97, 0x8d, 0xaa, 0xc6, 0xe7, 0xd5, 0xfb, 0x73, 0x6e, - 0x1e, 0xd4, 0x57, 0xfa, 0x9d, 0xb0, 0x0f, 0xaa, 0x06, 0xf7, 0x1a, 0x77, 0x51, 0xd0, 0xff, 0x72, - 0x31, 0x44, 0x5f, 0x2f, 0x86, 0xe8, 0xdb, 0xc5, 0x10, 0x7d, 0xf8, 0x3e, 0xfc, 0xe7, 0xa8, 0xa9, - 0x7f, 0x3e, 0x77, 0x7e, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf3, 0x47, 0xed, 0xb3, 0x8e, 0x06, 0x00, - 0x00, + // 735 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6e, 0xd4, 0x4a, + 0x10, 0xbd, 0x3d, 0xb6, 0xe7, 0x51, 0x93, 0x8c, 0x26, 0xad, 0xb9, 0x57, 0x56, 0x74, 0x35, 0xb2, + 0x5a, 0xf7, 0x4a, 0x16, 0x12, 0x89, 0x14, 0x36, 0x08, 0x21, 0x21, 0x3c, 0x33, 0x51, 0x46, 0x90, + 0x28, 0xe9, 0x04, 0x76, 0x2c, 0x3a, 0x49, 0x93, 0x58, 0xf1, 0x63, 0xb0, 0xdb, 0xc0, 0x2c, 0x59, + 0xf0, 0x0f, 0x08, 0xbe, 0x00, 0xbe, 0x84, 0x25, 0x9f, 0x80, 0xc2, 0x8f, 0xa0, 0x7e, 0xf8, 0x11, + 0x10, 0x21, 0x0b, 0x76, 0xae, 0x53, 0x5d, 0xd5, 0x75, 0xfa, 0x54, 0x95, 0x61, 0x10, 0x26, 0x82, + 0x67, 0x09, 0x8b, 0x36, 0x16, 0x59, 0x2a, 0x52, 0xdc, 0x2d, 0x6d, 0xb2, 0x03, 0xad, 0x69, 0x80, + 0x3d, 0xe8, 0x1f, 0x85, 0x31, 0x3f, 0x28, 0x58, 0x22, 0x8a, 0xd8, 0x45, 0x1e, 0xf2, 0x7b, 0xb4, + 0x09, 0xc9, 0x13, 0x93, 0x34, 0x2a, 0xe2, 0xe4, 0x31, 0x3b, 0xe6, 0x91, 0xdb, 0xd2, 0x27, 0x1a, + 0x10, 0x99, 0x81, 0xb3, 0x9d, 0xb1, 0x98, 0xdf, 0x20, 0xd9, 0x3a, 0x74, 0x69, 0xfa, 0xaa, 0x99, + 0xa9, 0xb2, 0x49, 0x00, 0xed, 0x20, 0x14, 0x31, 0x5b, 0x60, 0x0c, 0x76, 0x10, 0x8a, 0xdc, 0x45, + 0x9e, 0xe5, 0xdb, 0x54, 0x7d, 0xe3, 0xff, 0xc0, 0x79, 0x28, 0x44, 0x96, 0xbb, 0x2d, 0xcf, 0xf2, + 0xfb, 0x5b, 0x83, 0x8d, 0x8a, 0x98, 0x84, 0xa9, 0x76, 0x92, 0x0d, 0xb0, 0xf7, 0x59, 0x98, 0xe1, + 0x21, 0x58, 0x8f, 0xf8, 0x52, 0x55, 0x60, 0x53, 0xf9, 0x89, 0x47, 0xe0, 0x4c, 0xd2, 0x22, 0x11, + 0xea, 0x5a, 0x9b, 0x6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+ 0x08, 0x0c, 0xca, 0x52, 0x7f, 0xa5, 0x1b, 0x39, 0x85, 0x61, 0x10, 0xa5, 0x27, 0x17, 0x53, 0x26, + 0xd8, 0x9f, 0x60, 0x34, 0x02, 0x47, 0xe5, 0x33, 0x13, 0xa5, 0x0d, 0x72, 0x00, 0x6b, 0x8d, 0x5b, + 0x4c, 0x31, 0x57, 0xc8, 0xa3, 0xeb, 0xc9, 0xb7, 0x7e, 0x24, 0x4f, 0xfe, 0x07, 0x67, 0xc2, 0x4e, + 0xce, 0x7f, 0x93, 0x86, 0x7c, 0x40, 0xb0, 0xb6, 0xcb, 0x5e, 0xeb, 0xb9, 0xa8, 0xae, 0xde, 0x81, + 0x5e, 0x05, 0x9a, 0xc1, 0xbc, 0x55, 0x77, 0xc2, 0x4f, 0xe7, 0x6b, 0x64, 0x96, 0x88, 0x6c, 0x49, + 0xeb, 0xe0, 0xf5, 0xfb, 0x30, 0xb8, 0xea, 0x94, 0x6f, 0x7c, 0x51, 0xef, 0xa7, 0x0b, 0xbd, 0x70, + 0x5f, 0xaa, 0x45, 0x61, 0x16, 0xae, 0x32, 0xee, 0xb5, 0xee, 0xa2, 0x60, 0xf8, 0xf9, 0x72, 0x8c, + 0xbe, 0x5c, 0x8e, 0xd1, 0xd7, 0xcb, 0x31, 0x7a, 0xf7, 0x6d, 0xfc, 0xd7, 0x71, 0x5b, 0xfd, 0x9c, + 0xee, 0x7c, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x22, 0xbf, 0xb0, 0xae, 0x06, 0x00, 0x00, } diff --git a/internal/internal.proto b/internal/internal.proto index 8acbe0bab..67000243c 100644 --- a/internal/internal.proto +++ b/internal/internal.proto @@ -39,6 +39,7 @@ message Attr { string StringValue = 3; uint64 UintValue = 4; bool BoolValue = 5; + double FloatValue = 6; } message AttrMap { diff --git a/pilosa.go b/pilosa.go index b3620a900..5fddd85f9 100644 --- a/pilosa.go +++ b/pilosa.go @@ -2,9 +2,9 @@ package pilosa import ( "errors" + "regexp" "github.com/pilosa/pilosa/internal" - "regexp" ) // System errors. @@ -15,11 +15,11 @@ var ( ErrDatabaseExists = errors.New("database already exists") ErrDatabaseNotFound = errors.New("database not found") + // ErrFrameRequired is returned when no frame is specified. ErrFrameRequired = errors.New("frame required") ErrFrameExists = errors.New("frame already exists") ErrFrameNotFound = errors.New("frame not found") - // ErrFrameRequired is returned when no frame is specified. ErrName = errors.New("name restricted to [a-z0-9_-]") // ErrFragmentNotFound is returned when a fragment does not exist. @@ -84,12 +84,11 @@ func decodeProfile(pb *internal.Profile) *Profile { // TimeFormat is the go-style time format used to parse string dates. const TimeFormat = "2006-01-02T15:04" - // Restrict name using regex func ValidateName(name string) error { validName := nameRegexp.Match([]byte(name)) - if validName == false{ + if validName == false { return ErrName } return nil -} \ No newline at end of file +} From 7ffeeeede3d91e6e36bb6020d2234812ea0a0ed1 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 7 Mar 2017 15:44:53 -0600 Subject: [PATCH 06/10] fix duplicate case after rebase --- attr.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/attr.go b/attr.go index 6f031e839..804b51a34 100644 --- a/attr.go +++ b/attr.go @@ -266,8 +266,6 @@ func txUpdateAttrs(tx *bolt.Tx, id uint64, m map[string]interface{}) (map[string attr[k] = uint64(v) case uint: attr[k] = uint64(v) - case float64: - attr[k] = uint64(v) case int64: attr[k] = uint64(v) case string, uint64, bool, float64: From be8b976ba107360e435fcac4658fc9d85b460072 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 7 Mar 2017 15:56:02 -0600 Subject: [PATCH 07/10] update scanner comment and test float with trailing dot --- pql/parser_test.go | 4 +++- pql/scanner.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pql/parser_test.go b/pql/parser_test.go index 23582594b..e5bda9ca9 100644 --- a/pql/parser_test.go +++ b/pql/parser_test.go @@ -82,7 +82,7 @@ func TestParser_Parse(t *testing.T) { // Parse with float arguments. t.Run("WithFloatArgs", func(t *testing.T) { - q, err := pql.ParseString(`MyCall( key=12.25, foo= 13.167)`) + q, err := pql.ParseString(`MyCall( key=12.25, foo= 13.167, bar=2., baz=0.9)`) if err != nil { t.Fatal(err) } else if !reflect.DeepEqual(q.Calls[0], @@ -91,6 +91,8 @@ func TestParser_Parse(t *testing.T) { Args: map[string]interface{}{ "key": 12.25, "foo": 13.167, + "bar": 2., + "baz": 0.9, }, }, ) { diff --git a/pql/scanner.go b/pql/scanner.go index 7cbbcc85b..6fa0da377 100644 --- a/pql/scanner.go +++ b/pql/scanner.go @@ -140,7 +140,7 @@ func (s *Scanner) scanIdent() (tok Token, pos Pos, lit string) { return IDENT, pos, lit } -// scanNumber consumes consecutive integer digits. +// scanNumber consumes consecutive digits and up to one '.' character. func (s *Scanner) scanNumber() (tok Token, pos Pos, lit string) { pos = s.pos tok = NUMBER From f47c3a45218fbfda0fbe891a8b2f6faf49ed9e7b Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Wed, 8 Mar 2017 13:55:18 -0600 Subject: [PATCH 08/10] fix spaces/tab issue in Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 25d6bc6ad..2235a4655 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ .PHONY: glide vendor-update docker pilosa pilosactl crossbuild install generate GLIDE := $(shell command -v glide 2>/dev/null) +PROTOC := $(shell command -v protoc 2>/dev/null) VERSION := $(shell git describe --tags) IDENTIFIER := $(VERSION)-$(GOOS)-$(GOARCH) -PROTOC := $(shell command -v protoc 2> /dev/null) CLONE_URL=github.com/pilosa/pilosa BUILD_TIME=`date -u +%FT%T%z` LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)" @@ -46,7 +46,7 @@ install: vendor .protoc-gen-gofast: vendor ifndef PROTOC - $(error "protoc is not available please install protoc from https://github.com/google/protobuf/releases") + $(error "protoc is not available please install protoc from https://github.com/google/protobuf/releases") endif go build -o .protoc-gen-gofast ./vendor/github.com/gogo/protobuf/protoc-gen-gofast cp ./.protoc-gen-gofast $(GOPATH)/bin/protoc-gen-gofast From 69586ea07423a0ff375107408f8073c7235cec90 Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Wed, 8 Mar 2017 14:03:21 -0600 Subject: [PATCH 09/10] rename NUMBER -> INTEGER --- pql/parser.go | 4 ++-- pql/scanner.go | 2 +- pql/scanner_test.go | 2 +- pql/token.go | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pql/parser.go b/pql/parser.go index a5a72a0f7..346a47ccb 100644 --- a/pql/parser.go +++ b/pql/parser.go @@ -168,7 +168,7 @@ func (p *Parser) parseArgs() (map[string]interface{}, error) { } case STRING: value = lit - case NUMBER: + case INTEGER: v, err := strconv.ParseUint(lit, 10, 64) if err != nil { return nil, err @@ -225,7 +225,7 @@ func (p *Parser) parseList() ([]interface{}, error) { } case STRING: values = append(values, lit) - case NUMBER: + case INTEGER: v, err := strconv.ParseUint(lit, 10, 64) if err != nil { return nil, err diff --git a/pql/scanner.go b/pql/scanner.go index 6fa0da377..e51f0ab52 100644 --- a/pql/scanner.go +++ b/pql/scanner.go @@ -143,7 +143,7 @@ func (s *Scanner) scanIdent() (tok Token, pos Pos, lit string) { // scanNumber consumes consecutive digits and up to one '.' character. func (s *Scanner) scanNumber() (tok Token, pos Pos, lit string) { pos = s.pos - tok = NUMBER + tok = INTEGER var buf bytes.Buffer var seenDot bool diff --git a/pql/scanner_test.go b/pql/scanner_test.go index bc0cdd2f5..4dc2f4d8f 100644 --- a/pql/scanner_test.go +++ b/pql/scanner_test.go @@ -29,7 +29,7 @@ func TestScanner_Scan(t *testing.T) { {s: `]`, tok: pql.RBRACK, lit: `]`}, {s: `foo`, tok: pql.IDENT, lit: `foo`}, - {s: `100`, tok: pql.NUMBER, lit: `100`}, + {s: `100`, tok: pql.INTEGER, lit: `100`}, {s: `100.3`, tok: pql.FLOAT, lit: `100.3`}, {s: `all`, tok: pql.ALL, lit: `all`}, diff --git a/pql/token.go b/pql/token.go index 2fd263119..2ffc84400 100644 --- a/pql/token.go +++ b/pql/token.go @@ -15,7 +15,7 @@ const ( IDENT // main STRING // "foo" BADSTRING // bad escape or unclosed string - NUMBER // 12345 + INTEGER // 12345 FLOAT // 100.2 literal_end @@ -36,9 +36,9 @@ var tokens = [...]string{ EOF: "EOF", WS: "WS", - IDENT: "IDENT", - NUMBER: "NUMBER", - FLOAT: "FLOAT", + IDENT: "IDENT", + INTEGER: "INTEGER", + FLOAT: "FLOAT", ALL: "ALL", From 081660f5c84c289221743d6fc0832e4762a9b97e Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Thu, 9 Mar 2017 03:13:55 +0300 Subject: [PATCH 10/10] quick readme fix --- README.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.md b/README.md index 8a41a7c16..8236798c4 100644 --- a/README.md +++ b/README.md @@ -266,14 +266,8 @@ Returns the top 20 Bitmaps from `geo` sorted by the count of bits in the interse ``` TopN(Bitmap(project=10, frame="collaboration"), frame="geo", n=20, field="category", [81,82]) ``` -<<<<<<< HEAD - Returns the top 20 Bitmaps from `geo`in attribute `category` with values `81 or 82` sorted by the count of bits in the intersection with `Bitmap(project=10)`. -======= -Returns the top 20 Bitmaps from `bar`in attribute `category` with values `81 or -82` sorted by the count of bits in the intersection with `Bitmap(id=10)`. ->>>>>>> master ## Development