From 2a8172b2a3100ead64830a93159cc490a73710e4 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Mon, 26 Mar 2018 14:48:56 -0500 Subject: [PATCH 1/4] Remove RowLabel support --- executor.go | 47 ++++----- executor_test.go | 110 ++++++++++---------- fragment.go | 4 +- frame.go | 41 +------- frame_test.go | 43 -------- handler_internal_test.go | 9 +- handler_test.go | 4 +- index.go | 10 -- index_test.go | 34 +------ input_definition_test.go | 8 +- internal/private.pb.go | 214 +++++++++++++++------------------------ internal/private.proto | 1 - pilosa.go | 1 - server/cluster_test.go | 14 +-- server/server_test.go | 66 ++++++------ stats_test.go | 4 +- 16 files changed, 216 insertions(+), 394 deletions(-) diff --git a/executor.go b/executor.go index 854a9d8b9..de0d65df0 100644 --- a/executor.go +++ b/executor.go @@ -80,7 +80,6 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic // MaxSlice can differ between inverse and standard views, so we need // to send queries to different slices based on orientation. var inverseSlices []uint64 - rowLabel := DefaultRowLabel columnLabel := DefaultColumnLabel // If slices aren't specified, then include all of them. @@ -131,10 +130,9 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic if f == nil { return nil, ErrFrameNotFound } - rowLabel = f.RowLabel() // If this call is to an inverse frame send to a different list of slices. - if call.IsInverse(rowLabel, columnLabel) { + if call.IsInverse(DefaultRowLabel, columnLabel) { slices = inverseSlices } } @@ -280,8 +278,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C } else { frame, _ := c.Args["frame"].(string) if fr := idx.Frame(frame); fr != nil { - rowLabel := fr.RowLabel() - rowID, _, err := c.UintArg(rowLabel) + rowID, _, err := c.UintArg(DefaultRowLabel) if err != nil { return nil, err } @@ -536,18 +533,17 @@ func (e *Executor) executeBitmapSlice(ctx context.Context, index string, c *pql. if f == nil { return nil, ErrFrameNotFound } - rowLabel := f.RowLabel() // Return an error if both the row and column label are specified. - rowID, rowOK, rowErr := c.UintArg(rowLabel) + rowID, rowOK, rowErr := c.UintArg(DefaultRowLabel) columnID, columnOK, columnErr := c.UintArg(columnLabel) if rowErr != nil || columnErr != nil { return nil, fmt.Errorf("Bitmap() error with arg for col: %v or row: %v", columnErr, rowErr) } if rowOK && columnOK { - return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", rowLabel, columnLabel) + return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", DefaultRowLabel, columnLabel) } else if !rowOK && !columnOK { - return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", rowLabel, columnLabel) + return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", DefaultRowLabel, columnLabel) } // Determine row or column orientation. @@ -613,14 +609,13 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C if f == nil { return nil, ErrFrameNotFound } - rowLabel := f.RowLabel() // Read row & column id. columnID, columnOK, err := c.UintArg(columnLabel) if err != nil { return nil, fmt.Errorf("executeRangeSlice - reading column: %v", err) } - rowID, rowOK, err := c.UintArg(rowLabel) + rowID, rowOK, err := c.UintArg(DefaultRowLabel) if err != nil { return nil, fmt.Errorf("executeRangeSlice - reading row: %v", err) } @@ -629,9 +624,9 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C var id uint64 var viewName string if columnOK && rowOK { - return nil, fmt.Errorf("Range() cannot contain both %q and %q", columnLabel, rowLabel) + return nil, fmt.Errorf("Range() cannot contain both %q and %q", columnLabel, DefaultRowLabel) } else if !columnOK && !rowOK { - return nil, fmt.Errorf("Range() must specify either %q or %q", columnLabel, rowLabel) + return nil, fmt.Errorf("Range() must specify either %q or %q", columnLabel, DefaultRowLabel) } else if columnOK { viewName, id = ViewInverse, columnID } else { @@ -906,14 +901,13 @@ func (e *Executor) executeClearBit(ctx context.Context, index string, c *pql.Cal // Retrieve labels. columnLabel := idx.ColumnLabel() - rowLabel := f.RowLabel() // Read fields using labels. - rowID, ok, err := c.UintArg(rowLabel) + rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { return false, fmt.Errorf("reading ClearBit() row: %v", err) } else if !ok { - return false, fmt.Errorf("ClearBit() row field '%v' required", rowLabel) + return false, fmt.Errorf("ClearBit() row field '%v' required", DefaultRowLabel) } colID, ok, err := c.UintArg(columnLabel) @@ -1000,14 +994,13 @@ func (e *Executor) executeSetBit(ctx context.Context, index string, c *pql.Call, // Retrieve labels. columnLabel := idx.ColumnLabel() - rowLabel := f.RowLabel() // Read fields using labels. - rowID, ok, err := c.UintArg(rowLabel) + rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { return false, fmt.Errorf("reading SetBit() row: %v", err) } else if !ok { - return false, fmt.Errorf("SetBit() row field '%v' required", rowLabel) + return false, fmt.Errorf("SetBit() row field '%v' required", DefaultRowLabel) } colID, ok, err := c.UintArg(columnLabel) @@ -1171,20 +1164,19 @@ func (e *Executor) executeSetRowAttrs(ctx context.Context, index string, c *pql. if frame == nil { return ErrFrameNotFound } - rowLabel := frame.RowLabel() // Parse labels. - rowID, ok, err := c.UintArg(rowLabel) + rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { return fmt.Errorf("reading SetRowAttrs() row: %v", err) } else if !ok { - return fmt.Errorf("SetRowAttrs() row field '%v' required", rowLabel) + return fmt.Errorf("SetRowAttrs() row field '%v' required", DefaultRowLabel) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) delete(attrs, "frame") - delete(attrs, rowLabel) + delete(attrs, DefaultRowLabel) // Set attributes. if err := frame.RowAttrStore().SetAttrs(rowID, attrs); err != nil { @@ -1232,19 +1224,18 @@ func (e *Executor) executeBulkSetRowAttrs(ctx context.Context, index string, cal if f == nil { return nil, ErrFrameNotFound } - rowLabel := f.RowLabel() - rowID, ok, err := c.UintArg(rowLabel) + rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { - return nil, fmt.Errorf("reading SetRowAttrs() row: %v", rowLabel) + return nil, fmt.Errorf("reading SetRowAttrs() row: %v", DefaultRowLabel) } else if !ok { - return nil, fmt.Errorf("SetRowAttrs row field '%v' required", rowLabel) + return nil, fmt.Errorf("SetRowAttrs row field '%v' required", DefaultRowLabel) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) delete(attrs, "frame") - delete(attrs, rowLabel) + delete(attrs, DefaultRowLabel) // Create frame group, if not exists. frameMap := m[frame] diff --git a/executor_test.go b/executor_test.go index c98239137..d90c8048f 100644 --- a/executor_test.go +++ b/executor_test.go @@ -42,9 +42,9 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(``+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 10, 3)+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 10, SliceWidth+1)+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 20, SliceWidth+1), + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, 3)+ + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, SliceWidth+1)+ + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 20, SliceWidth+1), ), nil, nil); err != nil { t.Fatal(err) } @@ -52,7 +52,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { t.Fatal(err) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(row=10, frame=f)`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{3, SliceWidth + 1}) { t.Fatalf("unexpected bits: %+v", bits) @@ -61,7 +61,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { } // Inhibit bits. - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeBits: true}); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(row=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeBits: true}); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{}) { t.Fatalf("unexpected bits: %+v", bits) @@ -70,7 +70,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { } // Inhibit attributes. - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeAttrs: true}); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(row=10, frame=f)`), nil, &pilosa.ExecOptions{ExcludeAttrs: true}); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{3, SliceWidth + 1}) { t.Fatalf("unexpected bits: %+v", bits) @@ -91,9 +91,9 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(``+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 10, 3)+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 10, SliceWidth+1)+ - fmt.Sprintf("SetBit(frame=f, rowID=%d, columnID=%d)\n", 20, SliceWidth+1), + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, 3)+ + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, SliceWidth+1)+ + fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 20, SliceWidth+1), ), nil, nil); err != nil { t.Fatal(err) } @@ -122,7 +122,7 @@ func TestExecutor_Execute_Difference(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "general", pilosa.ViewStandard, 0).MustSetBits(11, 4) e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Difference(Bitmap(rowID=10), Bitmap(rowID=11))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Difference(Bitmap(row=10), Bitmap(row=11))`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{1, 3}) { t.Fatalf("unexpected bits: %+v", bits) @@ -154,7 +154,7 @@ func TestExecutor_Execute_Intersect(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "general", pilosa.ViewStandard, 1).MustSetBits(11, SliceWidth+2) e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Intersect(Bitmap(rowID=10), Bitmap(rowID=11))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Intersect(Bitmap(row=10), Bitmap(row=11))`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{1, SliceWidth + 2}) { t.Fatalf("unexpected bits: %+v", bits) @@ -184,7 +184,7 @@ func TestExecutor_Execute_Union(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "general", pilosa.ViewStandard, 1).MustSetBits(11, SliceWidth+2) e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Union(Bitmap(rowID=10), Bitmap(rowID=11))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Union(Bitmap(row=10), Bitmap(row=11))`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{0, 2, SliceWidth + 1, SliceWidth + 2}) { t.Fatalf("unexpected bits: %+v", bits) @@ -217,7 +217,7 @@ func TestExecutor_Execute_Xor(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "general", pilosa.ViewStandard, 1).MustSetBits(11, SliceWidth+2) e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Xor(Bitmap(rowID=10), Bitmap(rowID=11))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Xor(Bitmap(row=10), Bitmap(row=11))`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{0, 2, SliceWidth + 1}) { t.Fatalf("unexpected bits: %+v", bits) @@ -233,7 +233,7 @@ func TestExecutor_Execute_Count(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "f", pilosa.ViewStandard, 1).MustSetBits(10, SliceWidth+2) e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Count(Bitmap(rowID=10, frame=f))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Count(Bitmap(row=10, frame=f))`), nil, nil); err != nil { t.Fatal(err) } else if res[0] != uint64(3) { t.Fatalf("unexpected n: %d", res[0]) @@ -251,7 +251,7 @@ func TestExecutor_Execute_SetBit(t *testing.T) { t.Fatalf("unexpected bitmap count: %d", n) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(rowID=11, frame=f, columnID=1)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, columnID=1)`), nil, nil); err != nil { t.Fatal(err) } else { if !res[0].(bool) { @@ -262,7 +262,7 @@ func TestExecutor_Execute_SetBit(t *testing.T) { if n := f.Row(11).Count(); n != 1 { t.Fatalf("unexpected bitmap count: %d", n) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(rowID=11, frame=f, columnID=1)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, columnID=1)`), nil, nil); err != nil { t.Fatal(err) } else { if res[0].(bool) { @@ -384,16 +384,16 @@ func TestExecutor_Execute_SetRowAttrs(t *testing.T) { // Set two fields on f/10. // Also set fields on other bitmaps and frames to test isolation. e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(rowID=10, frame=f, foo="bar")`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(row=10, frame=f, foo="bar")`), nil, nil); err != nil { t.Fatal(err) } - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(rowID=200, frame=f, YYY=1)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(row=200, frame=f, YYY=1)`), nil, nil); err != nil { t.Fatal(err) } - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(rowID=10, frame=xxx, YYY=1)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(row=10, frame=xxx, YYY=1)`), nil, nil); err != nil { t.Fatal(err) } - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(rowID=10, frame=f, baz=123, bat=true)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetRowAttrs(row=10, frame=f, baz=123, bat=true)`), nil, nil); err != nil { t.Fatal(err) } @@ -419,15 +419,15 @@ func TestExecutor_Execute_TopN(t *testing.T) { } else if _, err := idx.CreateFrame("other", pilosa.FrameOptions{InverseEnabled: true}); err != nil { t.Fatal(err) } else if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, rowID=0, columnID=0) - SetBit(frame=f, rowID=0, columnID=1) - SetBit(frame=f, rowID=0, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=f, rowID=0, columnID=`+strconv.Itoa(SliceWidth+2)+`) - SetBit(frame=f, rowID=0, columnID=`+strconv.Itoa((5*SliceWidth)+100)+`) - SetBit(frame=f, rowID=10, columnID=0) - SetBit(frame=f, rowID=10, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=f, rowID=20, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=other, rowID=0, columnID=0) + SetBit(frame=f, row=0, columnID=0) + SetBit(frame=f, row=0, columnID=1) + SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+2)+`) + SetBit(frame=f, row=0, columnID=`+strconv.Itoa((5*SliceWidth)+100)+`) + SetBit(frame=f, row=10, columnID=0) + SetBit(frame=f, row=10, columnID=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=f, row=20, columnID=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=other, row=0, columnID=0) `), nil, nil); err != nil { t.Fatal(err) } @@ -543,7 +543,7 @@ func TestExecutor_Execute_TopN_Src(t *testing.T) { // Execute query. e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if result, err := e.Execute(context.Background(), "i", test.MustParse(`TopN(Bitmap(rowID=100, frame=other), frame=f, n=3)`), nil, nil); err != nil { + if result, err := e.Execute(context.Background(), "i", test.MustParse(`TopN(Bitmap(row=100, frame=other), frame=f, n=3)`), nil, nil); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(result, []interface{}{[]pilosa.Pair{ {ID: 20, Count: 3}, @@ -590,7 +590,7 @@ func TestExecutor_Execute_TopN_Attr_Src(t *testing.T) { t.Fatal(err) } e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if result, err := e.Execute(context.Background(), "i", test.MustParse(`TopN(Bitmap(rowID=10,frame=f),frame="f", n=1, field="category", filters=[123])`), nil, nil); err != nil { + if result, err := e.Execute(context.Background(), "i", test.MustParse(`TopN(Bitmap(row=10,frame=f),frame="f", n=1, field="category", filters=[123])`), nil, nil); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(result, []interface{}{[]pilosa.Pair{ {ID: 10, Count: 1}, @@ -630,8 +630,8 @@ func TestExecutor_Execute_Sum(t *testing.T) { } if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, rowID=0, columnID=0) - SetBit(frame=f, rowID=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) + SetBit(frame=f, row=0, columnID=0) + SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) SetFieldValue(frame=f, foo=20, bar=2000, columnID=0) SetFieldValue(frame=f, foo=30, columnID=`+strconv.Itoa(SliceWidth)+`) @@ -652,7 +652,7 @@ func TestExecutor_Execute_Sum(t *testing.T) { }) t.Run("WithFilter", func(t *testing.T) { - if result, err := e.Execute(context.Background(), "i", test.MustParse(`Sum(Bitmap(frame=f, rowID=0), frame=f, field=foo)`), nil, nil); err != nil { + if result, err := e.Execute(context.Background(), "i", test.MustParse(`Sum(Bitmap(frame=f, row=0), frame=f, field=foo)`), nil, nil); err != nil { t.Fatal(err) } else if !reflect.DeepEqual(result[0], pilosa.SumCount{Sum: 80, Count: 2}) { t.Fatalf("unexpected result: %s", spew.Sdump(result)) @@ -679,22 +679,22 @@ func TestExecutor_Execute_Range(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, rowID=1, columnID=2, timestamp="1999-12-31T00:00") - SetBit(frame=f, rowID=1, columnID=3, timestamp="2000-01-01T00:00") - SetBit(frame=f, rowID=1, columnID=4, timestamp="2000-01-02T00:00") - SetBit(frame=f, rowID=1, columnID=5, timestamp="2000-02-01T00:00") - SetBit(frame=f, rowID=1, columnID=6, timestamp="2001-01-01T00:00") - SetBit(frame=f, rowID=1, columnID=7, timestamp="2002-01-01T02:00") + SetBit(frame=f, row=1, columnID=2, timestamp="1999-12-31T00:00") + SetBit(frame=f, row=1, columnID=3, timestamp="2000-01-01T00:00") + SetBit(frame=f, row=1, columnID=4, timestamp="2000-01-02T00:00") + SetBit(frame=f, row=1, columnID=5, timestamp="2000-02-01T00:00") + SetBit(frame=f, row=1, columnID=6, timestamp="2001-01-01T00:00") + SetBit(frame=f, row=1, columnID=7, timestamp="2002-01-01T02:00") - SetBit(frame=f, rowID=1, columnID=2, timestamp="1999-12-30T00:00") - SetBit(frame=f, rowID=1, columnID=2, timestamp="2002-02-01T00:00") - SetBit(frame=f, rowID=10, columnID=2, timestamp="2001-01-01T00:00") + SetBit(frame=f, row=1, columnID=2, timestamp="1999-12-30T00:00") + SetBit(frame=f, row=1, columnID=2, timestamp="2002-02-01T00:00") + SetBit(frame=f, row=10, columnID=2, timestamp="2001-01-01T00:00") `), nil, nil); err != nil { t.Fatal(err) } t.Run("Standard", func(t *testing.T) { - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Range(rowID=1, frame=f, start="1999-12-31T00:00", end="2002-01-01T03:00")`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Range(row=1, frame=f, start="1999-12-31T00:00", end="2002-01-01T03:00")`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{2, 3, 4, 5, 6, 7}) { t.Fatalf("unexpected bits: %+v", bits) @@ -751,8 +751,8 @@ func TestExecutor_Execute_FieldRange(t *testing.T) { } if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, rowID=0, columnID=0) - SetBit(frame=f, rowID=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) + SetBit(frame=f, row=0, columnID=0) + SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) SetFieldValue(frame=f, foo=20, bar=2000, columnID=50) SetFieldValue(frame=f, foo=30, columnID=`+strconv.Itoa(SliceWidth)+`) @@ -908,7 +908,7 @@ func TestExecutor_Execute_Remote_Bitmap(t *testing.T) { s.Handler.Executor.ExecuteFn = func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) { if index != "i" { t.Fatalf("unexpected index: %s", index) - } else if query.String() != `Bitmap(frame="f", rowID=10)` { + } else if query.String() != `Bitmap(frame="f", row=10)` { t.Fatalf("unexpected query: %s", query.String()) } else if !reflect.DeepEqual(slices, []uint64{1}) { t.Fatalf("unexpected slices: %+v", slices) @@ -931,7 +931,7 @@ func TestExecutor_Execute_Remote_Bitmap(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "f", pilosa.ViewStandard, 1).MustSetBits(10, (1*SliceWidth)+1) e := test.NewExecutor(hldr.Holder, c) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(rowID=10, frame=f)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Bitmap(row=10, frame=f)`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{1, 2, 2*SliceWidth + 4}) { t.Fatalf("unexpected bits: %+v", bits) @@ -966,7 +966,7 @@ func TestExecutor_Execute_Remote_Count(t *testing.T) { hldr.MustCreateFragmentIfNotExists("i", "f", pilosa.ViewStandard, 2).MustSetBits(10, (2*SliceWidth)+2) e := test.NewExecutor(hldr.Holder, c) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Count(Bitmap(rowID=10, frame=f))`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Count(Bitmap(row=10, frame=f))`), nil, nil); err != nil { t.Fatal(err) } else if res[0] != uint64(12) { t.Fatalf("unexpected n: %d", res[0]) @@ -994,7 +994,7 @@ func TestExecutor_Execute_Remote_SetBit(t *testing.T) { s.Handler.Executor.ExecuteFn = func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) { if index != `i` { t.Fatalf("unexpected index: %s", index) - } else if query.String() != `SetBit(columnID=2, frame="f", rowID=10)` { + } else if query.String() != `SetBit(columnID=2, frame="f", row=10)` { t.Fatalf("unexpected query: %s", query.String()) } remoteCalled = true @@ -1012,7 +1012,7 @@ func TestExecutor_Execute_Remote_SetBit(t *testing.T) { } e := test.NewExecutor(hldr.Holder, c) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(rowID=10, frame=f, columnID=2)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, columnID=2)`), nil, nil); err != nil { t.Fatal(err) } @@ -1046,7 +1046,7 @@ func TestExecutor_Execute_Remote_SetBit_With_Timestamp(t *testing.T) { s.Handler.Executor.ExecuteFn = func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) { if index != `i` { t.Fatalf("unexpected index: %s", index) - } else if query.String() != `SetBit(columnID=2, frame="f", rowID=10, timestamp="2016-12-11T10:09")` { + } else if query.String() != `SetBit(columnID=2, frame="f", row=10, timestamp="2016-12-11T10:09")` { t.Fatalf("unexpected query: %s", query.String()) } remoteCalled = true @@ -1066,7 +1066,7 @@ func TestExecutor_Execute_Remote_SetBit_With_Timestamp(t *testing.T) { } e := test.NewExecutor(hldr.Holder, c) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(rowID=10, frame=f, columnID=2, timestamp="2016-12-11T10:09")`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, columnID=2, timestamp="2016-12-11T10:09")`), nil, nil); err != nil { t.Fatal(err) } @@ -1169,7 +1169,7 @@ func TestExectutor_SetColumnAttrs_ExcludeFrame(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) // SetColumnAttrs call should exclude the frame attribute - _, err := e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', rowID=1, columnID=10)"), nil, nil) + _, err := e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, columnID=10)"), nil, nil) if err != nil { t.Fatal(err) } @@ -1186,7 +1186,7 @@ func TestExectutor_SetColumnAttrs_ExcludeFrame(t *testing.T) { } // SetColumnAttrs call should not break if frame is not specified - _, err = e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', rowID=1, columnID=20)"), nil, nil) + _, err = e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, columnID=20)"), nil, nil) if err != nil { t.Fatal(err) } diff --git a/fragment.go b/fragment.go index ab397af47..8b32182d6 100644 --- a/fragment.go +++ b/fragment.go @@ -1841,11 +1841,11 @@ func (s *FragmentSyncer) syncBlock(id int) error { // Only sync the standard block. for j := 0; j < len(set.ColumnIDs); j++ { - fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "SetBit(frame=%q, rowID=%d, columnID=%d)\n", f.Frame(), set.RowIDs[j], (f.Slice()*SliceWidth)+set.ColumnIDs[j]) + fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "SetBit(frame=%q, row=%d, columnID=%d)\n", f.Frame(), set.RowIDs[j], (f.Slice()*SliceWidth)+set.ColumnIDs[j]) count++ } for j := 0; j < len(clear.ColumnIDs); j++ { - fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "ClearBit(frame=%q, rowID=%d, columnID=%d)\n", f.Frame(), clear.RowIDs[j], (f.Slice()*SliceWidth)+clear.ColumnIDs[j]) + fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "ClearBit(frame=%q, row=%d, columnID=%d)\n", f.Frame(), clear.RowIDs[j], (f.Slice()*SliceWidth)+clear.ColumnIDs[j]) count++ } diff --git a/frame.go b/frame.go index 466d7ae96..060125385 100644 --- a/frame.go +++ b/frame.go @@ -32,7 +32,7 @@ import ( // Default frame settings. const ( - DefaultRowLabel = "rowID" + DefaultRowLabel = "row" DefaultCacheType = CacheTypeRanked DefaultInverseEnabled = false DefaultRangeEnabled = false @@ -87,7 +87,6 @@ func NewFrame(path, index, name string) (*Frame, error) { broadcaster: NopBroadcaster, Stats: NopStatsClient, - rowLabel: DefaultRowLabel, inverseEnabled: DefaultInverseEnabled, cacheType: DefaultCacheType, cacheSize: DefaultCacheSize, @@ -139,39 +138,6 @@ func (f *Frame) MaxInverseSlice() uint64 { return view.MaxSlice() } -// SetRowLabel sets the row labels. Persists to meta file on update. -func (f *Frame) SetRowLabel(v string) error { - f.mu.Lock() - defer f.mu.Unlock() - - // Ignore if no change occurred. - if v == "" || f.rowLabel == v { - return nil - } - - // Make sure rowLabel is valid name - err := ValidateLabel(v) - if err != nil { - return err - } - - // Persist meta data to disk on change. - f.rowLabel = v - if err := f.saveMeta(); err != nil { - return err - } - - return nil -} - -// RowLabel returns the row label. -func (f *Frame) RowLabel() string { - f.mu.RLock() - v := f.rowLabel - f.mu.RUnlock() - return v -} - // CacheType returns the caching mode for the frame. func (f *Frame) CacheType() string { return f.cacheType @@ -224,7 +190,6 @@ func (f *Frame) Options() FrameOptions { func (f *Frame) options() FrameOptions { return FrameOptions{ - RowLabel: f.rowLabel, InverseEnabled: f.inverseEnabled, RangeEnabled: f.rangeEnabled, CacheType: f.cacheType, @@ -319,7 +284,6 @@ func (f *Frame) loadMeta() error { } // Copy metadata fields. - f.rowLabel = pb.RowLabel f.inverseEnabled = pb.InverseEnabled f.cacheType = pb.CacheType if f.cacheType == "" { @@ -1030,7 +994,6 @@ func (p frameInfoSlice) Less(i, j int) bool { return p[i].Name < p[j].Name } // FrameOptions represents options to set when initializing a frame. type FrameOptions struct { - RowLabel string `json:"rowLabel,omitempty"` InverseEnabled bool `json:"inverseEnabled,omitempty"` RangeEnabled bool `json:"rangeEnabled,omitempty"` CacheType string `json:"cacheType,omitempty"` @@ -1049,7 +1012,6 @@ func encodeFrameOptions(o *FrameOptions) *internal.FrameMeta { return nil } return &internal.FrameMeta{ - RowLabel: o.RowLabel, InverseEnabled: o.InverseEnabled, RangeEnabled: o.RangeEnabled, CacheType: o.CacheType, @@ -1064,7 +1026,6 @@ func decodeFrameOptions(options *internal.FrameMeta) *FrameOptions { return nil } return &FrameOptions{ - RowLabel: options.RowLabel, InverseEnabled: options.InverseEnabled, RangeEnabled: options.RangeEnabled, CacheType: options.CacheType, diff --git a/frame_test.go b/frame_test.go index 6e4ade84a..2107bd703 100644 --- a/frame_test.go +++ b/frame_test.go @@ -267,49 +267,6 @@ func TestFrame_NameValidation(t *testing.T) { } } -// Ensure that frame RowLable validation is consistent. -func TestFrame_RowLabelValidation(t *testing.T) { - validRowLabels := []string{ - "", - "foo", - "hyphen-ated", - "under_score", - "abc123", - "trailing_", - "camelCase", - "UPPERCASE", - } - invalidRowLabels := []string{ - "123abc", - "x.y", - "_foo", - "-bar", - "abc def", - "a12345678901234567890123456789012345678901234567890123456789012345", - } - - path, err := ioutil.TempDir("", "pilosa-frame-") - if err != nil { - panic(err) - } - f, err := pilosa.NewFrame(path, "i", "f") - if err != nil { - t.Fatalf("unexpected frame error: %s", err) - } - - for _, label := range validRowLabels { - if err := f.SetRowLabel(label); err != nil { - t.Fatalf("unexpected row label: %s %s", label, err) - } - } - for _, label := range invalidRowLabels { - if err := f.SetRowLabel(label); err == nil { - t.Fatalf("expected error on row label: %s", label) - } - } - -} - // Ensure frame can open and retrieve a view. func TestFrame_DeleteView(t *testing.T) { f := test.MustOpenFrame() diff --git a/handler_internal_test.go b/handler_internal_test.go index 169267c38..fb6226ea9 100644 --- a/handler_internal_test.go +++ b/handler_internal_test.go @@ -66,11 +66,10 @@ func TestPostFrameRequestUnmarshalJSON(t *testing.T) { {json: `{"options": {}}`, expected: postFrameRequest{Options: FrameOptions{}}}, {json: `{"options": 4}`, err: "options is not map[string]interface{}"}, {json: `{"option": {}}`, err: "Unknown key: option:map[]"}, - {json: `{"options": {"rowLabel": "test"}}`, expected: postFrameRequest{Options: FrameOptions{RowLabel: "test"}}}, - {json: `{"options": {"rowLabl": "test"}}`, err: "Unknown key: rowLabl:test"}, - {json: `{"options": {"rowLabel": "test", "inverseEnabled": true}}`, expected: postFrameRequest{Options: FrameOptions{RowLabel: "test", InverseEnabled: true}}}, - {json: `{"options": {"rowLabel": "test", "inverseEnabled": true, "cacheType": "type"}}`, expected: postFrameRequest{Options: FrameOptions{RowLabel: "test", InverseEnabled: true, CacheType: "type"}}}, - {json: `{"options": {"rowLabel": "test", "inverse": true, "cacheType": "type"}}`, err: "Unknown key: inverse:true"}, + {json: `{"options": {"rowLabel": "test"}}`, err: "Unknown key: rowLabel:test"}, + {json: `{"options": {"inverseEnabled": true}}`, expected: postFrameRequest{Options: FrameOptions{InverseEnabled: true}}}, + {json: `{"options": {"inverseEnabled": true, "cacheType": "type"}}`, expected: postFrameRequest{Options: FrameOptions{InverseEnabled: true, CacheType: "type"}}}, + {json: `{"options": {"inverse": true, "cacheType": "type"}}`, err: "Unknown key: inverse:true"}, } for _, test := range tests { actual := &postFrameRequest{} diff --git a/handler_test.go b/handler_test.go index 551c81d66..3c9c08094 100644 --- a/handler_test.go +++ b/handler_test.go @@ -1433,7 +1433,7 @@ func TestHandler_DeleteInputDefinition(t *testing.T) { // Test input definition is deleted. index := hldr.MustCreateIndexIfNotExists("i0", pilosa.IndexOptions{}) - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} @@ -1470,7 +1470,7 @@ func TestHandler_GetInputDefinition(t *testing.T) { h.Holder = hldr.Holder h.Cluster = test.NewCluster(1) - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} diff --git a/index.go b/index.go index 707b87213..968bac847 100644 --- a/index.go +++ b/index.go @@ -446,11 +446,6 @@ func (i *Index) createFrame(name string, opt FrameOptions) (*Frame, error) { return nil, ErrInvalidCacheType } - // Validate that row label does not match column label. - if i.columnLabel == opt.RowLabel || (opt.RowLabel == "" && i.columnLabel == DefaultRowLabel) { - return nil, ErrColumnRowLabelEqual - } - // Validate mutually exclusive options if ranges are enabled. if opt.RangeEnabled { if opt.InverseEnabled { @@ -496,10 +491,6 @@ func (i *Index) createFrame(name string, opt FrameOptions) (*Frame, error) { } f.cacheType = opt.CacheType - // Set options. - if opt.RowLabel != "" { - f.rowLabel = opt.RowLabel - } if opt.CacheSize != 0 { f.cacheSize = opt.CacheSize } @@ -694,7 +685,6 @@ func (i *Index) createInputDefinition(pb *internal.InputDefinition) (*InputDefin for _, fr := range pb.Frames { opt := FrameOptions{ // Deprecating row labels per #810. So, setting the default row label here. - RowLabel: DefaultRowLabel, InverseEnabled: fr.Meta.InverseEnabled, CacheType: fr.Meta.CacheType, CacheSize: fr.Meta.CacheSize, diff --git a/index_test.go b/index_test.go index 23a820f2d..c8cd238e8 100644 --- a/index_test.go +++ b/index_test.go @@ -215,32 +215,6 @@ func TestIndex_CreateFrame(t *testing.T) { } }) }) - - // Ensure frame cannot be created with a matching row label. - t.Run("ErrColumnRowLabelEqual", func(t *testing.T) { - t.Run("Explicit", func(t *testing.T) { - index := test.MustOpenIndex() - defer index.Close() - - _, err := index.CreateFrame("f", pilosa.FrameOptions{RowLabel: pilosa.DefaultColumnLabel}) - if err != pilosa.ErrColumnRowLabelEqual { - t.Fatalf("unexpected error: %s", err) - } - }) - - t.Run("Default", func(t *testing.T) { - index := test.MustOpenIndex() - defer index.Close() - if err := index.SetColumnLabel(pilosa.DefaultRowLabel); err != nil { - t.Fatal(err) - } - - _, err := index.CreateFrame("f", pilosa.FrameOptions{}) - if err != pilosa.ErrColumnRowLabelEqual { - t.Fatalf("unexpected error: %s", err) - } - }) - }) } // Ensure index can delete a frame. @@ -303,7 +277,7 @@ func TestIndex_CreateInputDefinition(t *testing.T) { defer index.Close() // Create Input Definition. - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} field := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&field}} @@ -330,7 +304,7 @@ func TestIndex_CreateExistingInputDefinition(t *testing.T) { } // Create Input Definition. - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def = internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} @@ -350,7 +324,7 @@ func TestIndex_DeleteInputDefinition(t *testing.T) { defer index.Close() // Create Input Definition. - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} @@ -381,7 +355,7 @@ func TestIndex_CreateFrameWhenOpenInputDefinition(t *testing.T) { defer index.Close() // Create Input Definition. - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "test", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} diff --git a/input_definition_test.go b/input_definition_test.go index 93d0e393d..efd13bec3 100644 --- a/input_definition_test.go +++ b/input_definition_test.go @@ -30,7 +30,7 @@ func TestInputDefinition_Open(t *testing.T) { defer index.Close() // Create Input Definition. - frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{RowLabel: "row"}} + frames := internal.Frame{Name: "f", Meta: &internal.FrameMeta{}} action := internal.InputDefinitionAction{Frame: "f", ValueDestination: "mapping", ValueMap: map[string]uint64{"Green": 1}} fields := internal.InputDefinitionField{Name: "id", PrimaryKey: true, InputDefinitionActions: []*internal.InputDefinitionAction{&action}} def := internal.InputDefinition{Name: "^", Frames: []*internal.Frame{&frames}, Fields: []*internal.InputDefinitionField{&fields}} @@ -115,14 +115,14 @@ func TestActionValidation(t *testing.T) { t.Fatalf("Expect error: %s, actual err: %s", pilosa.ErrInputDefinitionAttrsRequired, err) } - frame := pilosa.InputFrame{Name: "f", Options: pilosa.FrameOptions{RowLabel: "row"}} + frame := pilosa.InputFrame{Name: "f", Options: pilosa.FrameOptions{}} info = pilosa.InputDefinitionInfo{Frames: []pilosa.InputFrame{frame}, Fields: []pilosa.InputDefinitionField{field}} err = info.Validate() if !strings.Contains(err.Error(), "rowID required for single-row-boolean") { t.Fatalf("Expected rowID required for single-row-boolean error, actual error: %s", err) } - frame = pilosa.InputFrame{Name: "^", Options: pilosa.FrameOptions{RowLabel: "row"}} + frame = pilosa.InputFrame{Name: "^", Options: pilosa.FrameOptions{}} action = pilosa.Action{Frame: "f", ValueDestination: pilosa.InputSingleRowBool, RowID: &rowID} field = pilosa.InputDefinitionField{Name: "id", PrimaryKey: true, Actions: []pilosa.Action{action}} info = pilosa.InputDefinitionInfo{Frames: []pilosa.InputFrame{frame}, Fields: []pilosa.InputDefinitionField{field}} @@ -131,7 +131,7 @@ func TestActionValidation(t *testing.T) { t.Fatalf("Expect error: %s, actual err: %s", pilosa.ErrName, err) } - frame = pilosa.InputFrame{Name: "f", Options: pilosa.FrameOptions{RowLabel: "row"}} + frame = pilosa.InputFrame{Name: "f", Options: pilosa.FrameOptions{}} action = pilosa.Action{ValueDestination: pilosa.InputSingleRowBool, RowID: &rowID} field = pilosa.InputDefinitionField{Name: "id", PrimaryKey: true, Actions: []pilosa.Action{action}} info = pilosa.InputDefinitionInfo{Frames: []pilosa.InputFrame{frame}, Fields: []pilosa.InputDefinitionField{field}} diff --git a/internal/private.pb.go b/internal/private.pb.go index 1b7f71ac4..488aca0fe 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -92,7 +92,6 @@ func (m *IndexMeta) GetTimeQuantum() string { } type FrameMeta struct { - RowLabel string `protobuf:"bytes,1,opt,name=RowLabel,proto3" json:"RowLabel,omitempty"` InverseEnabled bool `protobuf:"varint,2,opt,name=InverseEnabled,proto3" json:"InverseEnabled,omitempty"` CacheType string `protobuf:"bytes,3,opt,name=CacheType,proto3" json:"CacheType,omitempty"` CacheSize uint32 `protobuf:"varint,4,opt,name=CacheSize,proto3" json:"CacheSize,omitempty"` @@ -106,13 +105,6 @@ func (m *FrameMeta) String() string { return proto.CompactTextString( func (*FrameMeta) ProtoMessage() {} func (*FrameMeta) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{1} } -func (m *FrameMeta) GetRowLabel() string { - if m != nil { - return m.RowLabel - } - return "" -} - func (m *FrameMeta) GetInverseEnabled() bool { if m != nil { return m.InverseEnabled @@ -1278,12 +1270,6 @@ func (m *FrameMeta) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.RowLabel) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPrivate(dAtA, i, uint64(len(m.RowLabel))) - i += copy(dAtA[i:], m.RowLabel) - } if m.InverseEnabled { dAtA[i] = 0x10 i++ @@ -2788,10 +2774,6 @@ func (m *IndexMeta) Size() (n int) { func (m *FrameMeta) Size() (n int) { var l int _ = l - l = len(m.RowLabel) - if l > 0 { - n += 1 + l + sovPrivate(uint64(l)) - } if m.InverseEnabled { n += 2 } @@ -3583,35 +3565,6 @@ func (m *FrameMeta) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: FrameMeta: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RowLabel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrivate - } - 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 ErrInvalidLengthPrivate - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RowLabel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field InverseEnabled", wireType) @@ -8667,89 +8620,88 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 1334 bytes of a gzipped FileDescriptorProto + // 1326 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x5d, 0x6f, 0x1b, 0x45, - 0x17, 0x7e, 0xd7, 0x6b, 0x3b, 0xf6, 0x71, 0x9c, 0x38, 0xd3, 0x34, 0xaf, 0x13, 0x45, 0xae, 0x19, - 0x15, 0x1a, 0x2a, 0x11, 0x95, 0x54, 0x42, 0x34, 0x50, 0xa9, 0xc4, 0x76, 0xd5, 0x85, 0x26, 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xa9, 0x28, 0x49, 0x59, 0x3a, 0x28, 0x13, 0x25, 0x20, 0xac, 0x8e, 0xa2, 0x39, 0x2f, - 0x24, 0x9c, 0x05, 0x4a, 0xe4, 0x1a, 0xfe, 0xd1, 0x02, 0x30, 0x84, 0x06, 0x51, 0x6c, 0x62, 0xcd, - 0x36, 0x41, 0xef, 0xa6, 0xde, 0x2e, 0x93, 0x33, 0x35, 0x5e, 0x22, 0xa9, 0x17, 0xce, 0x86, 0x19, - 0xa1, 0xba, 0x38, 0x2a, 0x89, 0xbe, 0xc2, 0x75, 0x9a, 0xc4, 0xb5, 0x59, 0x6e, 0x78, 0x83, 0x88, - 0xb3, 0x50, 0x33, 0x12, 0x6f, 0x2c, 0x05, 0xc4, 0xf1, 0x49, 0x80, 0xe9, 0x21, 0x42, 0x77, 0x21, - 0x27, 0x98, 0x9a, 0x39, 0x30, 0x7e, 0x0c, 0xb5, 0x88, 0xdb, 0xfa, 0x26, 0x99, 0x3a, 0x7b, 0x10, - 0x64, 0xe5, 0x8b, 0x5a, 0x97, 0x8b, 0x7c, 0x4c, 0x57, 0xc0, 0xde, 0x75, 0x55, 0x7d, 0xdb, 0x44, - 0x7c, 0x4a, 0x84, 0x9e, 0xcb, 0xfe, 0x13, 0x08, 0x15, 0x6f, 0x89, 0x25, 0xd5, 0x40, 0xe2, 0xee, - 0xb8, 0xc9, 0xfd, 0x66, 0x1e, 0xa5, 0x76, 0xea, 0x51, 0xda, 0x86, 0x25, 0xd5, 0x24, 0xff, 0xa5, - 0xd3, 0x9f, 0x33, 0xb0, 0x44, 0x58, 0xe4, 0xbe, 0x62, 0x8e, 0x1f, 0xf1, 0x70, 0x10, 0x0f, 0xb8, - 0x8f, 0x83, 0x23, 0x1d, 0x6a, 0x9b, 0x28, 0xe1, 0x75, 0x2a, 0x09, 0x3d, 0x10, 0xbf, 0x47, 0xa3, - 0xd5, 0x3f, 0xa9, 0x9a, 0x56, 0x41, 0x0f, 0x60, 0xae, 0x1d, 0x0c, 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 0x7f, 0x7d, 0xd9, 0x74, 0x7e, 0x7b, 0xd9, + 0x74, 0xfe, 0x78, 0xd9, 0x74, 0x7e, 0xfa, 0xb3, 0xf9, 0xbf, 0xbd, 0xb2, 0xfa, 0x93, 0xbf, 0xf1, + 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x13, 0x1d, 0x50, 0xda, 0x0f, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index 8642d9a13..ca987ec51 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -8,7 +8,6 @@ message IndexMeta { } message FrameMeta { - string RowLabel = 1; bool InverseEnabled = 2; string CacheType = 3; uint32 CacheSize = 4; diff --git a/pilosa.go b/pilosa.go index 98c67203f..71b63fcaa 100644 --- a/pilosa.go +++ b/pilosa.go @@ -36,7 +36,6 @@ var ( ErrFrameExists = errors.New("frame already exists") ErrFrameNotFound = errors.New("frame not found") ErrFrameInverseDisabled = errors.New("frame inverse disabled") - ErrColumnRowLabelEqual = errors.New("column and row labels cannot be equal") ErrInputDefinitionExists = errors.New("input-definition already exists") ErrInputDefinitionHasPrimaryKey = errors.New("input-definition must contain one PrimaryKey") diff --git a/server/cluster_test.go b/server/cluster_test.go index fbb784691..de623bbd4 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -153,8 +153,8 @@ func TestMain_SendReceiveMessage(t *testing.T) { // Write data on first node. if _, err := m0.Query("i", "", ` - SetBit(rowID=1, frame="f", columnID=1) - SetBit(rowID=1, frame="f", columnID=2400000) + SetBit(row=1, frame="f", columnID=1) + SetBit(row=1, frame="f", columnID=2400000) `); err != nil { t.Fatal(err) } @@ -351,8 +351,8 @@ func TestClusterResize_AddNode(t *testing.T) { // Write data on first node. if _, err := m0.Query("i", "", ` - SetBit(rowID=1, frame="f", columnID=1) - SetBit(rowID=1, frame="f", columnID=1300000) + SetBit(row=1, frame="f", columnID=1) + SetBit(row=1, frame="f", columnID=1300000) `); err != nil { t.Fatal(err) } @@ -406,8 +406,8 @@ func TestClusterResize_AddNode(t *testing.T) { // Write data on first node. Note that no data is placed on slice 1. if _, err := m0.Query("i", "", ` - SetBit(rowID=1, frame="f", columnID=1) - SetBit(rowID=1, frame="f", columnID=2400000) + SetBit(row=1, frame="f", columnID=1) + SetBit(row=1, frame="f", columnID=2400000) `); err != nil { t.Fatal(err) } @@ -560,7 +560,7 @@ func TestClusterResize_RemoveNode(t *testing.T) { // TODO: Deterministic node IDs would ensure consistent results setBits := "" for i := 0; i < 20; i++ { - setBits += fmt.Sprintf("SetBit(rowID=1, frame=\"f\", columnID=%d) ", i*pilosa.SliceWidth) + setBits += fmt.Sprintf("SetBit(row=1, frame=\"f\", columnID=%d) ", i*pilosa.SliceWidth) } if _, err := m0.Query("i", "", setBits); err != nil { diff --git a/server/server_test.go b/server/server_test.go index 3852845a6..28155bab4 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -56,7 +56,7 @@ func TestMain_Set_Quick(t *testing.T) { if err := client.CreateFrame(context.Background(), "i", cmd.Frame, pilosa.FrameOptions{}); err != nil && err != pilosa.ErrFrameExists { t.Fatal(err) } - if _, err := m.Query("i", "", fmt.Sprintf(`SetBit(rowID=%d, frame=%q, columnID=%d)`, cmd.ID, cmd.Frame, cmd.ColumnID)); err != nil { + if _, err := m.Query("i", "", fmt.Sprintf(`SetBit(row=%d, frame=%q, columnID=%d)`, cmd.ID, cmd.Frame, cmd.ColumnID)); err != nil { t.Fatal(err) } } @@ -72,7 +72,7 @@ func TestMain_Set_Quick(t *testing.T) { }, }, }) + "\n" - if res, err := m.Query("i", "", fmt.Sprintf(`Bitmap(rowID=%d, frame=%q)`, id, frame)); err != nil { + if res, err := m.Query("i", "", fmt.Sprintf(`Bitmap(row=%d, frame=%q)`, id, frame)); err != nil { t.Fatal(err) } else if res != exp { t.Fatalf("unexpected result:\n\ngot=%s\n\nexp=%s\n\n", res, exp) @@ -95,7 +95,7 @@ func TestMain_Set_Quick(t *testing.T) { }, }, }) + "\n" - if res, err := m.Query("i", "", fmt.Sprintf(`Bitmap(rowID=%d, frame=%q)`, id, frame)); err != nil { + if res, err := m.Query("i", "", fmt.Sprintf(`Bitmap(row=%d, frame=%q)`, id, frame)); err != nil { t.Fatal(err) } else if res != exp { t.Fatalf("unexpected result (reopen):\n\ngot=%s\n\nexp=%s\n\n", res, exp) @@ -131,36 +131,36 @@ func TestMain_SetRowAttrs(t *testing.T) { } // Set bits on different rows in different frames. - if _, err := m.Query("i", "", `SetBit(rowID=1, frame="x", columnID=100)`); err != nil { + if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(rowID=2, frame="x", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=2, frame="x", columnID=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(rowID=2, frame="z", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=2, frame="z", columnID=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(rowID=3, frame="neg", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=3, frame="neg", columnID=100)`); err != nil { t.Fatal(err) } // Set row attributes. - if _, err := m.Query("i", "", `SetRowAttrs(rowID=1, frame="x", x=100)`); err != nil { + if _, err := m.Query("i", "", `SetRowAttrs(row=1, frame="x", x=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetRowAttrs(rowID=2, frame="x", x=-200)`); err != nil { + } else if _, err := m.Query("i", "", `SetRowAttrs(row=2, frame="x", x=-200)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetRowAttrs(rowID=2, frame="z", x=300)`); err != nil { + } else if _, err := m.Query("i", "", `SetRowAttrs(row=2, frame="z", x=300)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetRowAttrs(rowID=3, frame="neg", x=-0.44)`); err != nil { + } else if _, err := m.Query("i", "", `SetRowAttrs(row=3, frame="neg", x=-0.44)`); err != nil { t.Fatal(err) } // Query row x/1. - if res, err := m.Query("i", "", `Bitmap(rowID=1, frame="x")`); err != nil { + if res, err := m.Query("i", "", `Bitmap(row=1, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{"x":100},"bits":[100]}]}`+"\n" { t.Fatalf("unexpected result: %s", res) } // Query row x/2. - if res, err := m.Query("i", "", `Bitmap(rowID=2, frame="x")`); err != nil { + if res, err := m.Query("i", "", `Bitmap(row=2, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{"x":-200},"bits":[100]}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -171,19 +171,19 @@ func TestMain_SetRowAttrs(t *testing.T) { } // Query rows after reopening. - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(rowID=1, frame="x")`); err != nil { + if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=1, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{"x":100},"bits":[100]}]}`+"\n" { t.Fatalf("unexpected result(reopen): %s", res) } - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(rowID=3, frame="neg")`); err != nil { + if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=3, frame="neg")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{"x":-0.44},"bits":[100]}]}`+"\n" { t.Fatalf("unexpected result(reopen): %s", res) } // Query row x/2. - if res, err := m.Query("i", "", `Bitmap(rowID=2, frame="x")`); err != nil { + if res, err := m.Query("i", "", `Bitmap(row=2, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{"x":-200},"bits":[100]}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -204,9 +204,9 @@ func TestMain_SetColumnAttrs(t *testing.T) { } // Set bits on row. - if _, err := m.Query("i", "", `SetBit(rowID=1, frame="x", columnID=100)`); err != nil { + if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(rowID=1, frame="x", columnID=101)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=101)`); err != nil { t.Fatal(err) } @@ -216,7 +216,7 @@ func TestMain_SetColumnAttrs(t *testing.T) { } // Query row. - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(rowID=1, frame="x")`); err != nil { + if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=1, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{},"bits":[100,101]}],"columnAttrs":[{"id":100,"attrs":{"foo":"bar"}}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -227,7 +227,7 @@ func TestMain_SetColumnAttrs(t *testing.T) { } // Query row after reopening. - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(rowID=1, frame="x")`); err != nil { + if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=1, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{},"bits":[100,101]}],"columnAttrs":[{"id":100,"attrs":{"foo":"bar"}}]}`+"\n" { t.Fatalf("unexpected result(reopen): %s", res) @@ -248,9 +248,9 @@ func TestMain_SetColumnAttrsWithColumnOption(t *testing.T) { } // Set bits on row. - if _, err := m.Query("i", "", `SetBit(rowID=1, frame="x", col=100)`); err != nil { + if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(rowID=1, frame="x", col=101)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=101)`); err != nil { t.Fatal(err) } @@ -260,7 +260,7 @@ func TestMain_SetColumnAttrsWithColumnOption(t *testing.T) { } // Query row. - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(rowID=1, frame="x")`); err != nil { + if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=1, frame="x")`); err != nil { t.Fatal(err) } else if res != `{"results":[{"attrs":{},"bits":[100,101]}],"columnAttrs":[{"id":100,"attrs":{"foo":"bar"}}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -285,19 +285,19 @@ func TestMain_FrameRestore(t *testing.T) { // Write data on first cluster. if _, err := m10.Query("i", "", ` - SetBit(rowID=1, frame="f", columnID=100) - SetBit(rowID=1, frame="f", columnID=1000) - SetBit(rowID=1, frame="f", columnID=100000) - SetBit(rowID=1, frame="f", columnID=200000) - SetBit(rowID=1, frame="f", columnID=400000) - SetBit(rowID=1, frame="f", columnID=600000) - SetBit(rowID=1, frame="f", columnID=800000) + SetBit(row=1, frame="f", columnID=100) + SetBit(row=1, frame="f", columnID=1000) + SetBit(row=1, frame="f", columnID=100000) + SetBit(row=1, frame="f", columnID=200000) + SetBit(row=1, frame="f", columnID=400000) + SetBit(row=1, frame="f", columnID=600000) + SetBit(row=1, frame="f", columnID=800000) `); err != nil { t.Fatal("setting bits:", err) } // Query row on first cluster. - if res, err := m10.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { + if res, err := m10.Query("i", "", `Bitmap(row=1, frame="f")`); err != nil { t.Fatal("bitmap query:", err) } else if res != `{"results":[{"attrs":{},"bits":[100,1000,100000,200000,400000,600000,800000]}]}`+"\n" { t.Fatalf("unexpected result: %s", res) @@ -335,7 +335,7 @@ func TestMain_FrameRestore(t *testing.T) { } // Query row on second cluster. - if res, err := m20.Query("i", "", `Bitmap(rowID=1, frame="f")`); err != nil { + if res, err := m20.Query("i", "", `Bitmap(row=1, frame="f")`); err != nil { t.Fatal("another bitmap query:", err) } else if res != `{"results":[{"attrs":{},"bits":[100,1000,100000,200000,400000,600000,800000]}]}`+"\n" { t.Fatalf("2unexpected result: %s", res) @@ -401,7 +401,7 @@ func TestMain_RecalculateHashes(t *testing.T) { data := []string{} for rowID := 1; rowID < 10; rowID++ { for columnID := 1; columnID < 100; columnID++ { - data = append(data, fmt.Sprintf(`SetBit(rowID=%d, frame="f", columnID=%d)`, rowID, columnID)) + data = append(data, fmt.Sprintf(`SetBit(row=%d, frame="f", columnID=%d)`, rowID, columnID)) } } if _, err := cluster[0].Query("i", "", strings.Join(data, "")); err != nil { diff --git a/stats_test.go b/stats_test.go index 93d7d9bb1..a03407a3d 100644 --- a/stats_test.go +++ b/stats_test.go @@ -143,7 +143,7 @@ func TestStatsCount_Bitmap(t *testing.T) { return }, } - if _, err := e.Execute(context.Background(), "d", test.MustParse(`Bitmap(frame=f, rowID=0)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "d", test.MustParse(`Bitmap(frame=f, row=0)`), nil, nil); err != nil { t.Fatal(err) } if !called { @@ -174,7 +174,7 @@ func TestStatsCount_SetBitmapAttrs(t *testing.T) { return }, } - if _, err := e.Execute(context.Background(), "d", test.MustParse(`SetRowAttrs(rowID=10, frame=f, foo="bar")`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "d", test.MustParse(`SetRowAttrs(row=10, frame=f, foo="bar")`), nil, nil); err != nil { t.Fatal(err) } if !called { From b2b0fd081afd96b5c4fdd9e23d7f7a20bf4f74ec Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Mon, 26 Mar 2018 15:35:56 -0500 Subject: [PATCH 2/4] Remove ColumnLabel support --- docs/examples.md | 11 +- executor.go | 70 ++++--------- executor_test.go | 120 +++++++++++----------- fragment.go | 4 +- frame.go | 2 - handler_internal_test.go | 3 +- handler_test.go | 4 +- holder.go | 1 - holder_test.go | 2 +- index.go | 46 +-------- input_definition.go | 2 +- internal/private.pb.go | 214 +++++++++++++++------------------------ internal/private.proto | 1 - pilosa.go | 1 - server.go | 1 - server/cluster_test.go | 16 +-- server/server_test.go | 66 +++--------- stats_test.go | 2 +- 18 files changed, 201 insertions(+), 365 deletions(-) diff --git a/docs/examples.md b/docs/examples.md index cf9885a3f..225e0f07c 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -267,12 +267,11 @@ First, follow the instruction in the [getting started](../getting-started/) guid The option cacheSize should be set as amount of chembl_id to calculate effectively for the whole data set, so we need to calculate amount of chembl_id. We have total 1678393 chembl_id (it will displayed after import_from_sdf.py script running), then the cacheSize should be >= 1678393 ``` curl localhost:10101/index/mole \ - -X POST \ - -d '{"options": {"columnLabel": "position_id"}}' + -X POST curl localhost:10101/index/mole/frame/fingerprint \ -X POST \ - -d '{"options": {"rowLabel": "chembl_id", "inverseEnabled": true, "cacheSize": 2000000, "cacheType": "ranked"}}' + -d '{"options": {"inverseEnabled": true, "cacheSize": 2000000, "cacheType": "ranked"}}' ``` @@ -302,7 +301,7 @@ Return chembl_id = 6223. This script uses Pilosa’s Intersection query to get a * Query all chembl_id that have all "on" positions from the inverse view, return list of chembl_id ```python - bit_maps = ["Bitmap(position_id=%s, frame=%s, inversed=%s)" % (f, frame, True) for f in fp] + bit_maps = ["Bitmap(col=%s, frame=%s, inversed=%s)" % (f, frame, True) for f in fp] bitmap_string = ', '.join(bit_maps) intersection = "Intersect(%s)" % bitmap_string mole_ids = requests.post("http://%s/index/%s/query" % (host, db), data=intersection).json()["results"][0]["bits"] @@ -312,7 +311,7 @@ Return chembl_id = 6223. This script uses Pilosa’s Intersection query to get a ```python for m in mole_ids: - mol = requests.post("http://%s/index/%s/query" % (host, db), data="Bitmap(chembl_id=%s, frame=%s)" % (m, frame)).json()["results"][0]["bits"] + mol = requests.post("http://%s/index/%s/query" % (host, db), data="Bitmap(row=%s, frame=%s)" % (m, frame)).json()["results"][0]["bits"] existed_mol = False if len(mol) == len(fp): found = m @@ -331,7 +330,7 @@ Return chembl_id = [6223, 269758, 6206, 6228]. This script uses Pilosa’s TopN * Query Pilosa’s TopN to get list of similarity chembl_id ```python - query_string = 'TopN(Bitmap(chembl_id=6223, frame="fingerprint"), frame="fingerprint", n=2000000, tanimotoThreshold=70)' + query_string = 'TopN(Bitmap(row=6223, frame="fingerprint"), frame="fingerprint", n=2000000, tanimotoThreshold=70)' topn = requests.post("http://127.0.0.1:10101/index/mol/query" , data=query_string) ``` diff --git a/executor.go b/executor.go index de0d65df0..0ed6dbaed 100644 --- a/executor.go +++ b/executor.go @@ -80,7 +80,6 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic // MaxSlice can differ between inverse and standard views, so we need // to send queries to different slices based on orientation. var inverseSlices []uint64 - columnLabel := DefaultColumnLabel // If slices aren't specified, then include all of them. if len(slices) == 0 { @@ -105,9 +104,6 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic for i := range inverseSlices { inverseSlices[i] = uint64(i) } - - // Fetch column label from index. - columnLabel = idx.ColumnLabel() } } @@ -132,7 +128,7 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic } // If this call is to an inverse frame send to a different list of slices. - if call.IsInverse(DefaultRowLabel, columnLabel) { + if call.IsInverse(DefaultRowLabel, DefaultColumnLabel) { slices = inverseSlices } } @@ -266,8 +262,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C } else { idx := e.Holder.Index(index) if idx != nil { - columnLabel := idx.ColumnLabel() - if columnID, ok, err := c.UintArg(columnLabel); ok && err == nil { + if columnID, ok, err := c.UintArg(DefaultColumnLabel); ok && err == nil { attrs, err := idx.ColumnAttrStore().Attrs(columnID) if err != nil { return nil, err @@ -522,7 +517,6 @@ func (e *Executor) executeBitmapSlice(ctx context.Context, index string, c *pql. if idx == nil { return nil, ErrIndexNotFound } - columnLabel := idx.ColumnLabel() // Fetch frame & row label based on argument. frame, _ := c.Args["frame"].(string) @@ -536,14 +530,14 @@ func (e *Executor) executeBitmapSlice(ctx context.Context, index string, c *pql. // Return an error if both the row and column label are specified. rowID, rowOK, rowErr := c.UintArg(DefaultRowLabel) - columnID, columnOK, columnErr := c.UintArg(columnLabel) + columnID, columnOK, columnErr := c.UintArg(DefaultColumnLabel) if rowErr != nil || columnErr != nil { return nil, fmt.Errorf("Bitmap() error with arg for col: %v or row: %v", columnErr, rowErr) } if rowOK && columnOK { - return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", DefaultRowLabel, columnLabel) + return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", DefaultRowLabel, DefaultColumnLabel) } else if !rowOK && !columnOK { - return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", DefaultRowLabel, columnLabel) + return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", DefaultRowLabel, DefaultColumnLabel) } // Determine row or column orientation. @@ -602,7 +596,6 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C if idx == nil { return nil, ErrIndexNotFound } - columnLabel := idx.ColumnLabel() // Retrieve base frame. f := idx.Frame(frame) @@ -611,7 +604,7 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C } // Read row & column id. - columnID, columnOK, err := c.UintArg(columnLabel) + columnID, columnOK, err := c.UintArg(DefaultColumnLabel) if err != nil { return nil, fmt.Errorf("executeRangeSlice - reading column: %v", err) } @@ -624,9 +617,9 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C var id uint64 var viewName string if columnOK && rowOK { - return nil, fmt.Errorf("Range() cannot contain both %q and %q", columnLabel, DefaultRowLabel) + return nil, fmt.Errorf("Range() cannot contain both %q and %q", DefaultColumnLabel, DefaultRowLabel) } else if !columnOK && !rowOK { - return nil, fmt.Errorf("Range() must specify either %q or %q", columnLabel, DefaultRowLabel) + return nil, fmt.Errorf("Range() must specify either %q or %q", DefaultColumnLabel, DefaultRowLabel) } else if columnOK { viewName, id = ViewInverse, columnID } else { @@ -899,9 +892,6 @@ func (e *Executor) executeClearBit(ctx context.Context, index string, c *pql.Cal return false, ErrFrameNotFound } - // Retrieve labels. - columnLabel := idx.ColumnLabel() - // Read fields using labels. rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { @@ -910,11 +900,11 @@ func (e *Executor) executeClearBit(ctx context.Context, index string, c *pql.Cal return false, fmt.Errorf("ClearBit() row field '%v' required", DefaultRowLabel) } - colID, ok, err := c.UintArg(columnLabel) + colID, ok, err := c.UintArg(DefaultColumnLabel) if err != nil { return false, fmt.Errorf("reading ClearBit() column: %v", err) } else if !ok { - return false, fmt.Errorf("ClearBit col field '%v' required", columnLabel) + return false, fmt.Errorf("ClearBit col field '%v' required", DefaultColumnLabel) } // Clear bits for each view. @@ -992,9 +982,6 @@ func (e *Executor) executeSetBit(ctx context.Context, index string, c *pql.Call, return false, ErrFrameNotFound } - // Retrieve labels. - columnLabel := idx.ColumnLabel() - // Read fields using labels. rowID, ok, err := c.UintArg(DefaultRowLabel) if err != nil { @@ -1003,11 +990,11 @@ func (e *Executor) executeSetBit(ctx context.Context, index string, c *pql.Call, return false, fmt.Errorf("SetBit() row field '%v' required", DefaultRowLabel) } - colID, ok, err := c.UintArg(columnLabel) + colID, ok, err := c.UintArg(DefaultColumnLabel) if err != nil { return false, fmt.Errorf("reading SetBit() column: %v", err) } else if !ok { - return false, fmt.Errorf("SetBit() column field '%v' required", columnLabel) + return false, fmt.Errorf("SetBit() column field '%v' required", DefaultColumnLabel) } var timestamp *time.Time @@ -1086,13 +1073,6 @@ func (e *Executor) executeSetFieldValue(ctx context.Context, index string, c *pq return errors.New("SetFieldValue() frame required") } - // Retrieve column label. - idx := e.Holder.Index(index) - if idx == nil { - return ErrIndexNotFound - } - columnLabel := idx.ColumnLabel() - // Retrieve frame. frame := e.Holder.Frame(index, frameName) if frame == nil { @@ -1100,11 +1080,11 @@ func (e *Executor) executeSetFieldValue(ctx context.Context, index string, c *pq } // Parse labels. - columnID, ok, err := c.UintArg(columnLabel) + columnID, ok, err := c.UintArg(DefaultColumnLabel) if err != nil { return fmt.Errorf("reading SetFieldValue() column: %v", err) } else if !ok { - return fmt.Errorf("SetFieldValue() column field '%v' required", columnLabel) + return fmt.Errorf("SetFieldValue() column field '%v' required", DefaultColumnLabel) } // Copy args and remove reserved fields. @@ -1112,7 +1092,7 @@ func (e *Executor) executeSetFieldValue(ctx context.Context, index string, c *pq delete(args, "frame") // While frame could technically work as a ColumnAttr argument, we are treating it as a reserved word primarily to avoid confusion. // Also, if we ever need to make ColumnAttrs frame-specific, then having this reserved word prevents backward incompatibility. - delete(args, columnLabel) + delete(args, DefaultColumnLabel) // Set values. for name, value := range args { @@ -1304,28 +1284,18 @@ func (e *Executor) executeSetColumnAttrs(ctx context.Context, index string, c *p return ErrIndexNotFound } - var colName string - id, okID, errID := c.UintArg("id") - if errID != nil || !okID { - // Retrieve columnLabel - columnLabel := idx.columnLabel - col, okCol, errCol := c.UintArg(columnLabel) - if errCol != nil || !okCol { - return fmt.Errorf("reading SetColumnAttrs() id/columnLabel errs: %v/%v found %v/%v", errID, errCol, okID, okCol) - } - id = col - colName = columnLabel - } else { - colName = "id" + col, okCol, errCol := c.UintArg(DefaultColumnLabel) + if errCol != nil || !okCol { + return fmt.Errorf("reading SetColumnAttrs() col errs: %v found %v", errCol, okCol) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) - delete(attrs, colName) + delete(attrs, DefaultColumnLabel) delete(attrs, "frame") // Set attributes. - if err := idx.ColumnAttrStore().SetAttrs(id, attrs); err != nil { + if err := idx.ColumnAttrStore().SetAttrs(col, attrs); err != nil { return err } idx.Stats.Count("SetProfileAttrs", 1, 1.0) diff --git a/executor_test.go b/executor_test.go index d90c8048f..1a23eba14 100644 --- a/executor_test.go +++ b/executor_test.go @@ -42,9 +42,9 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(``+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, 3)+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, SliceWidth+1)+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 20, SliceWidth+1), + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 10, 3)+ + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 10, SliceWidth+1)+ + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 20, SliceWidth+1), ), nil, nil); err != nil { t.Fatal(err) } @@ -91,9 +91,9 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(``+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, 3)+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 10, SliceWidth+1)+ - fmt.Sprintf("SetBit(frame=f, row=%d, columnID=%d)\n", 20, SliceWidth+1), + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 10, 3)+ + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 10, SliceWidth+1)+ + fmt.Sprintf("SetBit(frame=f, row=%d, col=%d)\n", 20, SliceWidth+1), ), nil, nil); err != nil { t.Fatal(err) } @@ -101,7 +101,7 @@ func TestExecutor_Execute_Bitmap(t *testing.T) { t.Fatal(err) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(fmt.Sprintf(`Bitmap(columnID=%d, frame=f)`, SliceWidth+1)), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(fmt.Sprintf(`Bitmap(col=%d, frame=f)`, SliceWidth+1)), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{10, 20}) { t.Fatalf("unexpected bits: %+v", bits) @@ -251,7 +251,7 @@ func TestExecutor_Execute_SetBit(t *testing.T) { t.Fatalf("unexpected bitmap count: %d", n) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, columnID=1)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, col=1)`), nil, nil); err != nil { t.Fatal(err) } else { if !res[0].(bool) { @@ -262,7 +262,7 @@ func TestExecutor_Execute_SetBit(t *testing.T) { if n := f.Row(11).Count(); n != 1 { t.Fatalf("unexpected bitmap count: %d", n) } - if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, columnID=1)`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=11, frame=f, col=1)`), nil, nil); err != nil { t.Fatal(err) } else { if res[0].(bool) { @@ -293,9 +293,9 @@ func TestExecutor_Execute_SetFieldValue(t *testing.T) { // Set field values. e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(columnID=10, frame=f, field0=25, field1=2)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(col=10, frame=f, field0=25, field1=2)`), nil, nil); err != nil { t.Fatal(err) - } else if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(columnID=100, frame=f, field0=10)`), nil, nil); err != nil { + } else if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(col=100, frame=f, field0=10)`), nil, nil); err != nil { t.Fatal(err) } @@ -340,28 +340,28 @@ func TestExecutor_Execute_SetFieldValue(t *testing.T) { t.Run("ErrFrameRequired", func(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(columnID=10, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() frame required` { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(col=10, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() frame required` { t.Fatalf("unexpected error: %s", err) } }) t.Run("ErrColumnFieldRequired", func(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(invalid_column_name=10, frame=f, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() column field 'columnID' required` { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(invalid_column_name=10, frame=f, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() column field 'col' required` { t.Fatalf("unexpected error: %s", err) } }) t.Run("ErrColumnFieldValue", func(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(invalid_column_name="bad_column", frame=f, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() column field 'columnID' required` { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(invalid_column_name="bad_column", frame=f, field0=100)`), nil, nil); err == nil || err.Error() != `SetFieldValue() column field 'col' required` { t.Fatalf("unexpected error: %s", err) } }) t.Run("ErrInvalidFieldValueType", func(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(columnID=10, frame=f, field0="hello")`), nil, nil); err == nil || err.Error() != `invalid field value type` { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetFieldValue(col=10, frame=f, field0="hello")`), nil, nil); err == nil || err.Error() != `invalid field value type` { t.Fatalf("unexpected error: %s", err) } }) @@ -419,15 +419,15 @@ func TestExecutor_Execute_TopN(t *testing.T) { } else if _, err := idx.CreateFrame("other", pilosa.FrameOptions{InverseEnabled: true}); err != nil { t.Fatal(err) } else if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, row=0, columnID=0) - SetBit(frame=f, row=0, columnID=1) - SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+2)+`) - SetBit(frame=f, row=0, columnID=`+strconv.Itoa((5*SliceWidth)+100)+`) - SetBit(frame=f, row=10, columnID=0) - SetBit(frame=f, row=10, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=f, row=20, columnID=`+strconv.Itoa(SliceWidth)+`) - SetBit(frame=other, row=0, columnID=0) + SetBit(frame=f, row=0, col=0) + SetBit(frame=f, row=0, col=1) + SetBit(frame=f, row=0, col=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=f, row=0, col=`+strconv.Itoa(SliceWidth+2)+`) + SetBit(frame=f, row=0, col=`+strconv.Itoa((5*SliceWidth)+100)+`) + SetBit(frame=f, row=10, col=0) + SetBit(frame=f, row=10, col=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=f, row=20, col=`+strconv.Itoa(SliceWidth)+`) + SetBit(frame=other, row=0, col=0) `), nil, nil); err != nil { t.Fatal(err) } @@ -630,15 +630,15 @@ func TestExecutor_Execute_Sum(t *testing.T) { } if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, row=0, columnID=0) - SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) + SetBit(frame=f, row=0, col=0) + SetBit(frame=f, row=0, col=`+strconv.Itoa(SliceWidth+1)+`) - SetFieldValue(frame=f, foo=20, bar=2000, columnID=0) - SetFieldValue(frame=f, foo=30, columnID=`+strconv.Itoa(SliceWidth)+`) - SetFieldValue(frame=f, foo=40, columnID=`+strconv.Itoa(SliceWidth+2)+`) - SetFieldValue(frame=f, foo=50, columnID=`+strconv.Itoa((5*SliceWidth)+100)+`) - SetFieldValue(frame=f, foo=60, columnID=`+strconv.Itoa(SliceWidth+1)+`) - SetFieldValue(frame=other, foo=1000, columnID=0) + SetFieldValue(frame=f, foo=20, bar=2000, col=0) + SetFieldValue(frame=f, foo=30, col=`+strconv.Itoa(SliceWidth)+`) + SetFieldValue(frame=f, foo=40, col=`+strconv.Itoa(SliceWidth+2)+`) + SetFieldValue(frame=f, foo=50, col=`+strconv.Itoa((5*SliceWidth)+100)+`) + SetFieldValue(frame=f, foo=60, col=`+strconv.Itoa(SliceWidth+1)+`) + SetFieldValue(frame=other, foo=1000, col=0) `), nil, nil); err != nil { t.Fatal(err) } @@ -679,16 +679,16 @@ func TestExecutor_Execute_Range(t *testing.T) { // Set bits. if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, row=1, columnID=2, timestamp="1999-12-31T00:00") - SetBit(frame=f, row=1, columnID=3, timestamp="2000-01-01T00:00") - SetBit(frame=f, row=1, columnID=4, timestamp="2000-01-02T00:00") - SetBit(frame=f, row=1, columnID=5, timestamp="2000-02-01T00:00") - SetBit(frame=f, row=1, columnID=6, timestamp="2001-01-01T00:00") - SetBit(frame=f, row=1, columnID=7, timestamp="2002-01-01T02:00") + SetBit(frame=f, row=1, col=2, timestamp="1999-12-31T00:00") + SetBit(frame=f, row=1, col=3, timestamp="2000-01-01T00:00") + SetBit(frame=f, row=1, col=4, timestamp="2000-01-02T00:00") + SetBit(frame=f, row=1, col=5, timestamp="2000-02-01T00:00") + SetBit(frame=f, row=1, col=6, timestamp="2001-01-01T00:00") + SetBit(frame=f, row=1, col=7, timestamp="2002-01-01T02:00") - SetBit(frame=f, row=1, columnID=2, timestamp="1999-12-30T00:00") - SetBit(frame=f, row=1, columnID=2, timestamp="2002-02-01T00:00") - SetBit(frame=f, row=10, columnID=2, timestamp="2001-01-01T00:00") + SetBit(frame=f, row=1, col=2, timestamp="1999-12-30T00:00") + SetBit(frame=f, row=1, col=2, timestamp="2002-02-01T00:00") + SetBit(frame=f, row=10, col=2, timestamp="2001-01-01T00:00") `), nil, nil); err != nil { t.Fatal(err) } @@ -703,7 +703,7 @@ func TestExecutor_Execute_Range(t *testing.T) { t.Run("Inverse", func(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) - if res, err := e.Execute(context.Background(), "i", test.MustParse(`Range(columnID=2, frame=f, start="1999-01-01T00:00", end="2003-01-01T00:00")`), nil, nil); err != nil { + if res, err := e.Execute(context.Background(), "i", test.MustParse(`Range(col=2, frame=f, start="1999-01-01T00:00", end="2003-01-01T00:00")`), nil, nil); err != nil { t.Fatal(err) } else if bits := res[0].(*pilosa.Bitmap).Bits(); !reflect.DeepEqual(bits, []uint64{1, 10}) { t.Fatalf("unexpected bits: %+v", bits) @@ -751,17 +751,17 @@ func TestExecutor_Execute_FieldRange(t *testing.T) { } if _, err := e.Execute(context.Background(), "i", test.MustParse(` - SetBit(frame=f, row=0, columnID=0) - SetBit(frame=f, row=0, columnID=`+strconv.Itoa(SliceWidth+1)+`) + SetBit(frame=f, row=0, col=0) + SetBit(frame=f, row=0, col=`+strconv.Itoa(SliceWidth+1)+`) - SetFieldValue(frame=f, foo=20, bar=2000, columnID=50) - SetFieldValue(frame=f, foo=30, columnID=`+strconv.Itoa(SliceWidth)+`) - SetFieldValue(frame=f, foo=10, columnID=`+strconv.Itoa(SliceWidth+2)+`) - SetFieldValue(frame=f, foo=20, columnID=`+strconv.Itoa((5*SliceWidth)+100)+`) - SetFieldValue(frame=f, foo=60, columnID=`+strconv.Itoa(SliceWidth+1)+`) - SetFieldValue(frame=other, foo=1000, columnID=0) - SetFieldValue(frame=edge, foo=100, columnID=0) - SetFieldValue(frame=edge, foo=-100, columnID=1) + SetFieldValue(frame=f, foo=20, bar=2000, col=50) + SetFieldValue(frame=f, foo=30, col=`+strconv.Itoa(SliceWidth)+`) + SetFieldValue(frame=f, foo=10, col=`+strconv.Itoa(SliceWidth+2)+`) + SetFieldValue(frame=f, foo=20, col=`+strconv.Itoa((5*SliceWidth)+100)+`) + SetFieldValue(frame=f, foo=60, col=`+strconv.Itoa(SliceWidth+1)+`) + SetFieldValue(frame=other, foo=1000, col=0) + SetFieldValue(frame=edge, foo=100, col=0) + SetFieldValue(frame=edge, foo=-100, col=1) `), nil, nil); err != nil { t.Fatal(err) } @@ -994,7 +994,7 @@ func TestExecutor_Execute_Remote_SetBit(t *testing.T) { s.Handler.Executor.ExecuteFn = func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) { if index != `i` { t.Fatalf("unexpected index: %s", index) - } else if query.String() != `SetBit(columnID=2, frame="f", row=10)` { + } else if query.String() != `SetBit(col=2, frame="f", row=10)` { t.Fatalf("unexpected query: %s", query.String()) } remoteCalled = true @@ -1012,7 +1012,7 @@ func TestExecutor_Execute_Remote_SetBit(t *testing.T) { } e := test.NewExecutor(hldr.Holder, c) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, columnID=2)`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, col=2)`), nil, nil); err != nil { t.Fatal(err) } @@ -1046,7 +1046,7 @@ func TestExecutor_Execute_Remote_SetBit_With_Timestamp(t *testing.T) { s.Handler.Executor.ExecuteFn = func(ctx context.Context, index string, query *pql.Query, slices []uint64, opt *pilosa.ExecOptions) ([]interface{}, error) { if index != `i` { t.Fatalf("unexpected index: %s", index) - } else if query.String() != `SetBit(columnID=2, frame="f", row=10, timestamp="2016-12-11T10:09")` { + } else if query.String() != `SetBit(col=2, frame="f", row=10, timestamp="2016-12-11T10:09")` { t.Fatalf("unexpected query: %s", query.String()) } remoteCalled = true @@ -1066,7 +1066,7 @@ func TestExecutor_Execute_Remote_SetBit_With_Timestamp(t *testing.T) { } e := test.NewExecutor(hldr.Holder, c) - if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, columnID=2, timestamp="2016-12-11T10:09")`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "i", test.MustParse(`SetBit(row=10, frame=f, col=2, timestamp="2016-12-11T10:09")`), nil, nil); err != nil { t.Fatal(err) } @@ -1169,11 +1169,11 @@ func TestExectutor_SetColumnAttrs_ExcludeFrame(t *testing.T) { e := test.NewExecutor(hldr.Holder, test.NewCluster(1)) // SetColumnAttrs call should exclude the frame attribute - _, err := e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, columnID=10)"), nil, nil) + _, err := e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, col=10)"), nil, nil) if err != nil { t.Fatal(err) } - _, err = e.Execute(context.Background(), "i", test.MustParse("SetColumnAttrs(frame='f', columnID=10, foo='bar')"), nil, nil) + _, err = e.Execute(context.Background(), "i", test.MustParse("SetColumnAttrs(frame='f', col=10, foo='bar')"), nil, nil) if err != nil { t.Fatal(err) } @@ -1186,11 +1186,11 @@ func TestExectutor_SetColumnAttrs_ExcludeFrame(t *testing.T) { } // SetColumnAttrs call should not break if frame is not specified - _, err = e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, columnID=20)"), nil, nil) + _, err = e.Execute(context.Background(), "i", test.MustParse("SetBit(frame='f', row=1, col=20)"), nil, nil) if err != nil { t.Fatal(err) } - _, err = e.Execute(context.Background(), "i", test.MustParse("SetColumnAttrs(columnID=20, foo='bar')"), nil, nil) + _, err = e.Execute(context.Background(), "i", test.MustParse("SetColumnAttrs(col=20, foo='bar')"), nil, nil) if err != nil { t.Fatal(err) } diff --git a/fragment.go b/fragment.go index 8b32182d6..093b14d34 100644 --- a/fragment.go +++ b/fragment.go @@ -1841,11 +1841,11 @@ func (s *FragmentSyncer) syncBlock(id int) error { // Only sync the standard block. for j := 0; j < len(set.ColumnIDs); j++ { - fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "SetBit(frame=%q, row=%d, columnID=%d)\n", f.Frame(), set.RowIDs[j], (f.Slice()*SliceWidth)+set.ColumnIDs[j]) + fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "SetBit(frame=%q, row=%d, col=%d)\n", f.Frame(), set.RowIDs[j], (f.Slice()*SliceWidth)+set.ColumnIDs[j]) count++ } for j := 0; j < len(clear.ColumnIDs); j++ { - fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "ClearBit(frame=%q, row=%d, columnID=%d)\n", f.Frame(), clear.RowIDs[j], (f.Slice()*SliceWidth)+clear.ColumnIDs[j]) + fmt.Fprintf(&(buffers[count/s.Cluster.MaxWritesPerRequest]), "ClearBit(frame=%q, row=%d, col=%d)\n", f.Frame(), clear.RowIDs[j], (f.Slice()*SliceWidth)+clear.ColumnIDs[j]) count++ } diff --git a/frame.go b/frame.go index 060125385..f786ac0b0 100644 --- a/frame.go +++ b/frame.go @@ -57,7 +57,6 @@ type Frame struct { Stats StatsClient // Frame options. - rowLabel string inverseEnabled bool cacheType string cacheSize uint32 @@ -267,7 +266,6 @@ func (f *Frame) loadMeta() error { // Read data from meta file. buf, err := ioutil.ReadFile(filepath.Join(f.path, ".meta")) if os.IsNotExist(err) { - f.rowLabel = DefaultRowLabel f.inverseEnabled = DefaultInverseEnabled f.cacheType = DefaultCacheType f.cacheSize = DefaultCacheSize diff --git a/handler_internal_test.go b/handler_internal_test.go index fb6226ea9..395ec73b6 100644 --- a/handler_internal_test.go +++ b/handler_internal_test.go @@ -30,8 +30,7 @@ func TestPostIndexRequestUnmarshalJSON(t *testing.T) { {json: `{"options": {}}`, expected: postIndexRequest{Options: IndexOptions{}}}, {json: `{"options": 4}`, err: "options is not map[string]interface{}"}, {json: `{"option": {}}`, err: "Unknown key: option:map[]"}, - {json: `{"options": {"columnLabel": "test"}}`, expected: postIndexRequest{Options: IndexOptions{ColumnLabel: "test"}}}, - {json: `{"options": {"columnLabl": "test"}}`, err: "Unknown key: columnLabl:test"}, + {json: `{"options": {"columnLabel": "test"}}`, err: "Unknown key: columnLabel:test"}, } for _, test := range tests { actual := &postIndexRequest{} diff --git a/handler_test.go b/handler_test.go index 3c9c08094..5e9b993f9 100644 --- a/handler_test.go +++ b/handler_test.go @@ -107,7 +107,7 @@ func TestHandler_Schema(t *testing.T) { if w.Code != http.StatusOK { t.Fatalf("unexpected status code: %d", w.Code) } else if body := w.Body.String(); body != `{"indexes":[{"name":"i0","frames":[{"name":"f0"},{"name":"f1","views":[{"name":"inverse"},{"name":"standard"}]}]},{"name":"i1","frames":[{"name":"f0","views":[{"name":"standard"}]}]}]}`+"\n" { - } else if body := w.Body.String(); body != `{"indexes":[{"name":"i0","frames":[{"name":"f0","options":{"rowLabel":"rowID","cacheType":"ranked","cacheSize":50000}},{"name":"f1","options":{"rowLabel":"rowID","inverseEnabled":true,"cacheType":"ranked","cacheSize":50000},"views":[{"name":"inverse"},{"name":"standard"}]}]},{"name":"i1","frames":[{"name":"f0","options":{"rowLabel":"rowID","cacheType":"ranked","cacheSize":50000},"views":[{"name":"standard"}]}]}]}`+"\n" { + } else if body := w.Body.String(); body != `{"indexes":[{"name":"i0","frames":[{"name":"f0","options":{"cacheType":"ranked","cacheSize":50000}},{"name":"f1","options":{"inverseEnabled":true,"cacheType":"ranked","cacheSize":50000},"views":[{"name":"inverse"},{"name":"standard"}]}]},{"name":"i1","frames":[{"name":"f0","options":{"cacheType":"ranked","cacheSize":50000},"views":[{"name":"standard"}]}]}]}`+"\n" { t.Fatalf("unexpected body: %s", body) } } @@ -1349,7 +1349,7 @@ func TestHandler_DuplicatePrimaryKey(t *testing.T) { } // Ensure throwing error if there's no primary key - hldr.MustCreateIndexIfNotExists("i1", pilosa.IndexOptions{ColumnLabel: "id"}) + hldr.MustCreateIndexIfNotExists("i1", pilosa.IndexOptions{}) unmatchColumnBody := []byte(` { "frames":[{ diff --git a/holder.go b/holder.go index 63bbbbc86..f418a145d 100644 --- a/holder.go +++ b/holder.go @@ -361,7 +361,6 @@ func (h *Holder) createIndex(name string, opt IndexOptions) (*Index, error) { } // Update options. - index.SetColumnLabel(opt.ColumnLabel) index.SetTimeQuantum(opt.TimeQuantum) h.indexes[index.Name()] = index diff --git a/holder_test.go b/holder_test.go index 5a06a9272..267a10372 100644 --- a/holder_test.go +++ b/holder_test.go @@ -68,7 +68,7 @@ func TestHolder_Open(t *testing.T) { h := test.MustOpenHolder() defer h.Close() - if _, err := h.CreateIndex("test", pilosa.IndexOptions{}); err != nil { + if _, err := h.CreateIndex("test", pilosa.IndexOptions{TimeQuantum: pilosa.TimeQuantum("YMDH")}); err != nil { t.Fatal(err) } else if err := h.Holder.Close(); err != nil { t.Fatal(err) diff --git a/index.go b/index.go index 968bac847..f17854e1e 100644 --- a/index.go +++ b/index.go @@ -31,7 +31,7 @@ import ( // Default index settings. const ( - DefaultColumnLabel = "columnID" + DefaultColumnLabel = "col" InputDefinitionDir = ".input-definitions" ) @@ -45,9 +45,6 @@ type Index struct { // This can be overridden by individual frames. timeQuantum TimeQuantum - // Label used for referring to columns in index. - columnLabel string - // Frames by name. frames map[string]*Frame @@ -88,8 +85,6 @@ func NewIndex(path, name string) (*Index, error) { NewAttrStore: NewNopAttrStore, columnAttrStore: NopAttrStore, - columnLabel: DefaultColumnLabel, - broadcaster: NopBroadcaster, Stats: NopStatsClient, LogOutput: ioutil.Discard, @@ -105,39 +100,6 @@ func (i *Index) Path() string { return i.path } // ColumnAttrStore returns the storage for column attributes. func (i *Index) ColumnAttrStore() AttrStore { return i.columnAttrStore } -// SetColumnLabel sets the column label. Persists to meta file on update. -func (i *Index) SetColumnLabel(v string) error { - i.mu.Lock() - defer i.mu.Unlock() - - // Ignore if no change occurred. - if v == "" || i.columnLabel == v { - return nil - } - - // Make sure columnLabel is valid name - err := ValidateLabel(v) - if err != nil { - return err - } - - // Persist meta data to disk on change. - i.columnLabel = v - if err := i.saveMeta(); err != nil { - return err - } - - return nil -} - -// ColumnLabel returns the column label. -func (i *Index) ColumnLabel() string { - i.mu.RLock() - v := i.columnLabel - i.mu.RUnlock() - return v -} - // Options returns all options for this index. func (i *Index) Options() IndexOptions { i.mu.RLock() @@ -147,7 +109,6 @@ func (i *Index) Options() IndexOptions { func (i *Index) options() IndexOptions { return IndexOptions{ - ColumnLabel: i.columnLabel, TimeQuantum: i.timeQuantum, } } @@ -217,7 +178,6 @@ func (i *Index) loadMeta() error { buf, err := ioutil.ReadFile(filepath.Join(i.path, ".meta")) if os.IsNotExist(err) { i.timeQuantum = "" - i.columnLabel = DefaultColumnLabel return nil } else if err != nil { return err @@ -229,7 +189,6 @@ func (i *Index) loadMeta() error { // Copy metadata fields. i.timeQuantum = TimeQuantum(pb.TimeQuantum) - i.columnLabel = pb.ColumnLabel return nil } @@ -239,7 +198,6 @@ func (i *Index) saveMeta() error { // Marshal metadata. buf, err := proto.Marshal(&internal.IndexMeta{ TimeQuantum: string(i.timeQuantum), - ColumnLabel: i.columnLabel, }) if err != nil { return err @@ -631,14 +589,12 @@ func encodeIndex(d *Index) *internal.Index { // IndexOptions represents options to set when initializing an index. type IndexOptions struct { - ColumnLabel string `json:"columnLabel,omitempty"` TimeQuantum TimeQuantum `json:"timeQuantum,omitempty"` } // Encode converts i into its internal representation. func (i *IndexOptions) Encode() *internal.IndexMeta { return &internal.IndexMeta{ - ColumnLabel: i.ColumnLabel, TimeQuantum: string(i.TimeQuantum), } } diff --git a/input_definition.go b/input_definition.go index f4571d0bb..b18b4980e 100644 --- a/input_definition.go +++ b/input_definition.go @@ -281,7 +281,7 @@ func (i *InputDefinitionInfo) Validate() error { } } - // Validate columnLabel and duplicate primaryKey. + // Validate duplicate primaryKey. for _, field := range i.Fields { if field.Name == "" { return ErrInputDefinitionNameRequired diff --git a/internal/private.pb.go b/internal/private.pb.go index 488aca0fe..0d0f3124a 100644 --- a/internal/private.pb.go +++ b/internal/private.pb.go @@ -68,7 +68,6 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type IndexMeta struct { - ColumnLabel string `protobuf:"bytes,1,opt,name=ColumnLabel,proto3" json:"ColumnLabel,omitempty"` TimeQuantum string `protobuf:"bytes,2,opt,name=TimeQuantum,proto3" json:"TimeQuantum,omitempty"` } @@ -77,13 +76,6 @@ func (m *IndexMeta) String() string { return proto.CompactTextString( func (*IndexMeta) ProtoMessage() {} func (*IndexMeta) Descriptor() ([]byte, []int) { return fileDescriptorPrivate, []int{0} } -func (m *IndexMeta) GetColumnLabel() string { - if m != nil { - return m.ColumnLabel - } - return "" -} - func (m *IndexMeta) GetTimeQuantum() string { if m != nil { return m.TimeQuantum @@ -1240,12 +1232,6 @@ func (m *IndexMeta) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.ColumnLabel) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintPrivate(dAtA, i, uint64(len(m.ColumnLabel))) - i += copy(dAtA[i:], m.ColumnLabel) - } if len(m.TimeQuantum) > 0 { dAtA[i] = 0x12 i++ @@ -2760,10 +2746,6 @@ func encodeVarintPrivate(dAtA []byte, offset int, v uint64) int { func (m *IndexMeta) Size() (n int) { var l int _ = l - l = len(m.ColumnLabel) - if l > 0 { - n += 1 + l + sovPrivate(uint64(l)) - } l = len(m.TimeQuantum) if l > 0 { n += 1 + l + sovPrivate(uint64(l)) @@ -3457,35 +3439,6 @@ func (m *IndexMeta) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: IndexMeta: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ColumnLabel", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPrivate - } - 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 ErrInvalidLengthPrivate - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ColumnLabel = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field TimeQuantum", wireType) @@ -8620,88 +8573,87 @@ var ( func init() { proto.RegisterFile("private.proto", fileDescriptorPrivate) } var fileDescriptorPrivate = []byte{ - // 1326 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x5d, 0x6f, 0x1b, 0x45, - 0x17, 0x7e, 0xd7, 0x6b, 0x3b, 0xf1, 0x71, 0x9d, 0x3a, 0xd3, 0x36, 0xaf, 0x5b, 0x45, 0xae, 0x19, - 0x15, 0x1a, 0x2a, 0x11, 0x95, 0x54, 0x42, 0xb4, 0x50, 0xa9, 0xd4, 0x76, 0xd5, 0x85, 0xa6, 0x94, - 0x71, 0x5b, 0x24, 0x24, 0x90, 0x26, 0xf6, 0x90, 0xae, 0xb2, 0xde, 0x35, 0xbb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 0x5f, 0x47, 0xe4, 0xf6, 0x4c, 0x1d, 0xa9, 0x3f, 0x97, 0xea, 0xce, 0xff, 0x33, 0x83, - 0xa9, 0x65, 0x36, 0xad, 0x4d, 0xbf, 0x77, 0xe0, 0x4c, 0x9e, 0xc2, 0x2b, 0x35, 0x46, 0x9a, 0x91, - 0xc2, 0xc2, 0x8c, 0xb8, 0x8b, 0x32, 0x52, 0xcc, 0x32, 0x92, 0xbd, 0x73, 0x4b, 0xb9, 0x77, 0x2e, - 0x3d, 0x80, 0x8b, 0x73, 0x69, 0x6a, 0x47, 0xc3, 0x11, 0xd6, 0xc3, 0xbf, 0x48, 0x17, 0x8e, 0x8c, - 0x38, 0x36, 0x89, 0xaa, 0x30, 0x2d, 0xd0, 0x9b, 0x70, 0xa1, 0x27, 0x64, 0x2e, 0x49, 0xb6, 0xda, - 0x5a, 0xe0, 0x3e, 0x14, 0xcf, 0x97, 0x1c, 0x1f, 0x97, 0xe8, 0x87, 0xd0, 0x78, 0x32, 0x1a, 0x70, - 0x29, 0x4e, 0x65, 0x7d, 0x17, 0x56, 0x1f, 0x47, 0xa3, 0x28, 0x88, 0xf6, 0x27, 0x27, 0xb4, 0x7c, - 0x03, 0x56, 0xf4, 0x7c, 0xd4, 0x8f, 0x94, 0x0a, 0xb3, 0x22, 0x3d, 0x87, 0x05, 0xdd, 0xe7, 0x41, - 0x7f, 0x1c, 0x20, 0x0d, 0xfc, 0xf7, 0x4a, 0xee, 0xd6, 0x7f, 0x7d, 0xd9, 0x74, 0x7e, 0x7b, 0xd9, - 0x74, 0xfe, 0x78, 0xd9, 0x74, 0x7e, 0xfa, 0xb3, 0xf9, 0xbf, 0xbd, 0xb2, 0xfa, 0x93, 0xbf, 0xf1, - 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x13, 0x1d, 0x50, 0xda, 0x0f, 0x00, 0x00, + // 1308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0xbd, 0xb6, 0x13, 0x3f, 0xd7, 0xa9, 0x33, 0x6d, 0x83, 0x5b, 0x45, 0xae, 0x19, 0x15, + 0x1a, 0x2a, 0x35, 0x2a, 0xa9, 0x84, 0x68, 0xa1, 0x52, 0x69, 0xec, 0xaa, 0x0b, 0xa4, 0x2a, 0xe3, + 0xb6, 0x48, 0x48, 0x20, 0x4d, 0xed, 0x21, 0x5d, 0x65, 0xbd, 0x6b, 0x76, 0xc7, 0x49, 0xdc, 0x03, + 0x47, 0x84, 0x84, 0xb8, 0x23, 0xae, 0x7c, 0x19, 0x8e, 0x7c, 0x02, 0x84, 0xc2, 0x87, 0xe0, 0x08, + 0x9a, 0x37, 0x33, 0xbb, 0xeb, 0x7f, 0x49, 0x13, 0xb8, 0xed, 0xfb, 0xff, 0x9b, 0xf7, 0x6f, 0x66, + 0xa1, 0x36, 0x8c, 0xfd, 0x7d, 0x2e, 0xc5, 0xe6, 0x30, 0x8e, 0x64, 0x44, 0x96, 0xfd, 0x50, 0x8a, + 0x38, 0xe4, 0x01, 0xbd, 0x09, 0x15, 0x2f, 0xec, 0x8b, 0xc3, 0x1d, 0x21, 0x39, 0x69, 0x41, 0xf5, + 0xa9, 0x3f, 0x10, 0x9f, 0x8f, 0x78, 0x28, 0x47, 0x83, 0x46, 0xa1, 0xe5, 0x6c, 0x54, 0x58, 0x9e, + 0x45, 0xff, 0x70, 0xa0, 0xf2, 0x30, 0xe6, 0x03, 0x81, 0xfa, 0xef, 0xc0, 0x8a, 0x17, 0xee, 0x8b, + 0x38, 0x11, 0x9d, 0x90, 0xbf, 0x08, 0x44, 0x1f, 0x4d, 0x96, 0xd9, 0x14, 0x97, 0xac, 0x43, 0x65, + 0x9b, 0xf7, 0x5e, 0x8a, 0xa7, 0xe3, 0xa1, 0x68, 0xb8, 0xe8, 0x35, 0x63, 0xa4, 0xd2, 0xae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0x67, 0x28, 0xbc, 0xf7, 0x94, 0x9e, 0x5d, 0x80, + 0x48, 0xd0, 0xcf, 0xb4, 0x87, 0xce, 0xbe, 0x08, 0x65, 0x2e, 0x4b, 0x48, 0xa3, 0x83, 0x1a, 0xd3, + 0x04, 0xa1, 0xfa, 0x28, 0x06, 0xf3, 0x4a, 0x86, 0x59, 0x71, 0x19, 0xca, 0xe8, 0x4f, 0x0e, 0x80, + 0x05, 0x34, 0x4a, 0x52, 0x13, 0x67, 0xb1, 0x09, 0x79, 0x2f, 0xf7, 0x76, 0x99, 0xdd, 0xa9, 0xa9, + 0x88, 0xe5, 0x5e, 0x38, 0x1b, 0x76, 0x85, 0x9a, 0xe6, 0xa8, 0x67, 0xfa, 0x9a, 0x6f, 0xca, 0xa4, + 0xae, 0xcd, 0xda, 0x76, 0x30, 0x4a, 0xa4, 0x88, 0x0d, 0x22, 0xf5, 0xc6, 0xd2, 0x8c, 0x34, 0x3f, + 0x19, 0x63, 0x7e, 0x8a, 0xc8, 0x35, 0x28, 0x29, 0xa4, 0x76, 0x0f, 0x4c, 0x1f, 0x43, 0x0b, 0x69, + 0xd7, 0xdc, 0x24, 0x73, 0x77, 0x0f, 0x81, 0x22, 0xbe, 0xa8, 0x4d, 0xbb, 0xe0, 0x63, 0xba, 0x0e, + 0xee, 0x8e, 0xaf, 0xfb, 0xdb, 0x65, 0xea, 0x13, 0x39, 0xfc, 0x10, 0xe7, 0x4f, 0x71, 0xb8, 0x7a, + 0x4b, 0xac, 0xea, 0x01, 0x52, 0x77, 0xc7, 0x59, 0xee, 0x37, 0xfb, 0x28, 0x75, 0x73, 0x8f, 0xd2, + 0x2e, 0xac, 0xea, 0x21, 0xf9, 0x3f, 0x9d, 0xfe, 0x52, 0x80, 0x55, 0x26, 0x12, 0xff, 0x95, 0xf0, + 0xc2, 0x44, 0xc6, 0xa3, 0x74, 0xc1, 0x7d, 0x12, 0xbd, 0x30, 0xa9, 0x76, 0x99, 0x26, 0x5e, 0xa7, + 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x7f, 0x35, 0xdf, 0x78, 0x51, 0xc6, 0xff, 0xf4, 0xdb, 0xff, 0x06, + 0x00, 0x00, 0xff, 0xff, 0xda, 0x68, 0xc4, 0x54, 0xb8, 0x0f, 0x00, 0x00, } diff --git a/internal/private.proto b/internal/private.proto index ca987ec51..7126811ac 100644 --- a/internal/private.proto +++ b/internal/private.proto @@ -3,7 +3,6 @@ syntax = "proto3"; package internal; message IndexMeta { - string ColumnLabel = 1; string TimeQuantum = 2; } diff --git a/pilosa.go b/pilosa.go index 71b63fcaa..a3e11b826 100644 --- a/pilosa.go +++ b/pilosa.go @@ -40,7 +40,6 @@ var ( ErrInputDefinitionExists = errors.New("input-definition already exists") ErrInputDefinitionHasPrimaryKey = errors.New("input-definition must contain one PrimaryKey") ErrInputDefinitionDupePrimaryKey = errors.New("input-definition can only contain one PrimaryKey") - ErrInputDefinitionColumnLabel = errors.New("PrimaryKey field name does not match columnLabel") ErrInputDefinitionNameRequired = errors.New("input-definition name required") ErrInputDefinitionAttrsRequired = errors.New("frames and fields are required") ErrInputDefinitionValueMap = errors.New("valueMap required for map") diff --git a/server.go b/server.go index 7f6eeb6cb..cb82de12d 100644 --- a/server.go +++ b/server.go @@ -378,7 +378,6 @@ func (s *Server) ReceiveMessage(pb proto.Message) error { } case *internal.CreateIndexMessage: opt := IndexOptions{ - ColumnLabel: obj.Meta.ColumnLabel, TimeQuantum: TimeQuantum(obj.Meta.TimeQuantum), } _, err := s.Holder.CreateIndex(obj.Index, opt) diff --git a/server/cluster_test.go b/server/cluster_test.go index de623bbd4..828aacdf7 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -153,8 +153,8 @@ func TestMain_SendReceiveMessage(t *testing.T) { // Write data on first node. if _, err := m0.Query("i", "", ` - SetBit(row=1, frame="f", columnID=1) - SetBit(row=1, frame="f", columnID=2400000) + SetBit(row=1, frame="f", col=1) + SetBit(row=1, frame="f", col=2400000) `); err != nil { t.Fatal(err) } @@ -187,7 +187,7 @@ func TestMain_SendReceiveMessage(t *testing.T) { "cacheType": "ranked", "timeQuantum": "YMD" }}], - "fields": [{"name": "columnID", + "fields": [{"name": "col", "primaryKey": true }]} `); err != nil { @@ -351,8 +351,8 @@ func TestClusterResize_AddNode(t *testing.T) { // Write data on first node. if _, err := m0.Query("i", "", ` - SetBit(row=1, frame="f", columnID=1) - SetBit(row=1, frame="f", columnID=1300000) + SetBit(row=1, frame="f", col=1) + SetBit(row=1, frame="f", col=1300000) `); err != nil { t.Fatal(err) } @@ -406,8 +406,8 @@ func TestClusterResize_AddNode(t *testing.T) { // Write data on first node. Note that no data is placed on slice 1. if _, err := m0.Query("i", "", ` - SetBit(row=1, frame="f", columnID=1) - SetBit(row=1, frame="f", columnID=2400000) + SetBit(row=1, frame="f", col=1) + SetBit(row=1, frame="f", col=2400000) `); err != nil { t.Fatal(err) } @@ -560,7 +560,7 @@ func TestClusterResize_RemoveNode(t *testing.T) { // TODO: Deterministic node IDs would ensure consistent results setBits := "" for i := 0; i < 20; i++ { - setBits += fmt.Sprintf("SetBit(row=1, frame=\"f\", columnID=%d) ", i*pilosa.SliceWidth) + setBits += fmt.Sprintf("SetBit(row=1, frame=\"f\", col=%d) ", i*pilosa.SliceWidth) } if _, err := m0.Query("i", "", setBits); err != nil { diff --git a/server/server_test.go b/server/server_test.go index 28155bab4..b91cb4317 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -56,7 +56,7 @@ func TestMain_Set_Quick(t *testing.T) { if err := client.CreateFrame(context.Background(), "i", cmd.Frame, pilosa.FrameOptions{}); err != nil && err != pilosa.ErrFrameExists { t.Fatal(err) } - if _, err := m.Query("i", "", fmt.Sprintf(`SetBit(row=%d, frame=%q, columnID=%d)`, cmd.ID, cmd.Frame, cmd.ColumnID)); err != nil { + if _, err := m.Query("i", "", fmt.Sprintf(`SetBit(row=%d, frame=%q, col=%d)`, cmd.ID, cmd.Frame, cmd.ColumnID)); err != nil { t.Fatal(err) } } @@ -131,13 +131,13 @@ func TestMain_SetRowAttrs(t *testing.T) { } // Set bits on different rows in different frames. - if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=100)`); err != nil { + if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(row=2, frame="x", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=2, frame="x", col=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(row=2, frame="z", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=2, frame="z", col=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(row=3, frame="neg", columnID=100)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=3, frame="neg", col=100)`); err != nil { t.Fatal(err) } @@ -204,14 +204,14 @@ func TestMain_SetColumnAttrs(t *testing.T) { } // Set bits on row. - if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=100)`); err != nil { + if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=100)`); err != nil { t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(row=1, frame="x", columnID=101)`); err != nil { + } else if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=101)`); err != nil { t.Fatal(err) } // Set column attributes. - if _, err := m.Query("i", "", `SetColumnAttrs(id=100, foo="bar")`); err != nil { + if _, err := m.Query("i", "", `SetColumnAttrs(col=100, foo="bar")`); err != nil { t.Fatal(err) } @@ -234,40 +234,6 @@ func TestMain_SetColumnAttrs(t *testing.T) { } } -// Ensure program can set column attributes with columnLabel option. -func TestMain_SetColumnAttrsWithColumnOption(t *testing.T) { - m := test.MustRunMain() - defer m.Close() - - // Create frames. - client := m.Client() - if err := client.CreateIndex(context.Background(), "i", pilosa.IndexOptions{ColumnLabel: "col"}); err != nil && err != pilosa.ErrIndexExists { - t.Fatal(err) - } else if err := client.CreateFrame(context.Background(), "i", "x", pilosa.FrameOptions{}); err != nil { - t.Fatal(err) - } - - // Set bits on row. - if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=100)`); err != nil { - t.Fatal(err) - } else if _, err := m.Query("i", "", `SetBit(row=1, frame="x", col=101)`); err != nil { - t.Fatal(err) - } - - // Set column attributes. - if _, err := m.Query("i", "", `SetColumnAttrs(col=100, foo="bar")`); err != nil { - t.Fatal(err) - } - - // Query row. - if res, err := m.Query("i", "columnAttrs=true", `Bitmap(row=1, frame="x")`); err != nil { - t.Fatal(err) - } else if res != `{"results":[{"attrs":{},"bits":[100,101]}],"columnAttrs":[{"id":100,"attrs":{"foo":"bar"}}]}`+"\n" { - t.Fatalf("unexpected result: %s", res) - } - -} - // Ensure program can set bits on one cluster and then restore to a second cluster. func TestMain_FrameRestore(t *testing.T) { mains1 := test.MustRunMainWithCluster(t, 2) @@ -285,13 +251,13 @@ func TestMain_FrameRestore(t *testing.T) { // Write data on first cluster. if _, err := m10.Query("i", "", ` - SetBit(row=1, frame="f", columnID=100) - SetBit(row=1, frame="f", columnID=1000) - SetBit(row=1, frame="f", columnID=100000) - SetBit(row=1, frame="f", columnID=200000) - SetBit(row=1, frame="f", columnID=400000) - SetBit(row=1, frame="f", columnID=600000) - SetBit(row=1, frame="f", columnID=800000) + SetBit(row=1, frame="f", col=100) + SetBit(row=1, frame="f", col=1000) + SetBit(row=1, frame="f", col=100000) + SetBit(row=1, frame="f", col=200000) + SetBit(row=1, frame="f", col=400000) + SetBit(row=1, frame="f", col=600000) + SetBit(row=1, frame="f", col=800000) `); err != nil { t.Fatal("setting bits:", err) } @@ -401,7 +367,7 @@ func TestMain_RecalculateHashes(t *testing.T) { data := []string{} for rowID := 1; rowID < 10; rowID++ { for columnID := 1; columnID < 100; columnID++ { - data = append(data, fmt.Sprintf(`SetBit(row=%d, frame="f", columnID=%d)`, rowID, columnID)) + data = append(data, fmt.Sprintf(`SetBit(row=%d, frame="f", col=%d)`, rowID, columnID)) } } if _, err := cluster[0].Query("i", "", strings.Join(data, "")); err != nil { diff --git a/stats_test.go b/stats_test.go index a03407a3d..3e85532a3 100644 --- a/stats_test.go +++ b/stats_test.go @@ -206,7 +206,7 @@ func TestStatsCount_SetProfileAttrs(t *testing.T) { return }, } - if _, err := e.Execute(context.Background(), "d", test.MustParse(`SetColumnAttrs(id=10, frame=f, foo="bar")`), nil, nil); err != nil { + if _, err := e.Execute(context.Background(), "d", test.MustParse(`SetColumnAttrs(col=10, frame=f, foo="bar")`), nil, nil); err != nil { t.Fatal(err) } if !called { From e3cd03d902174524de1082cff72c609b9342b8f6 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Mon, 2 Apr 2018 13:05:37 -0500 Subject: [PATCH 3/4] move rowLabel and columnLabel constants to executor.go --- executor.go | 65 ++++++++++++++++++++++++++++------------------------- frame.go | 1 - index.go | 1 - 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/executor.go b/executor.go index 0ed6dbaed..2154b60ff 100644 --- a/executor.go +++ b/executor.go @@ -33,6 +33,9 @@ const ( // MinThreshold is the lowest count to use in a Top-N operation when // looking for additional id/count pairs. MinThreshold = 1 + + columnLabel = "col" + rowLabel = "row" ) // Executor recursively executes calls in a PQL query across all slices. @@ -128,7 +131,7 @@ func (e *Executor) Execute(ctx context.Context, index string, q *pql.Query, slic } // If this call is to an inverse frame send to a different list of slices. - if call.IsInverse(DefaultRowLabel, DefaultColumnLabel) { + if call.IsInverse(rowLabel, columnLabel) { slices = inverseSlices } } @@ -262,7 +265,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C } else { idx := e.Holder.Index(index) if idx != nil { - if columnID, ok, err := c.UintArg(DefaultColumnLabel); ok && err == nil { + if columnID, ok, err := c.UintArg(columnLabel); ok && err == nil { attrs, err := idx.ColumnAttrStore().Attrs(columnID) if err != nil { return nil, err @@ -273,7 +276,7 @@ func (e *Executor) executeBitmapCall(ctx context.Context, index string, c *pql.C } else { frame, _ := c.Args["frame"].(string) if fr := idx.Frame(frame); fr != nil { - rowID, _, err := c.UintArg(DefaultRowLabel) + rowID, _, err := c.UintArg(rowLabel) if err != nil { return nil, err } @@ -529,15 +532,15 @@ func (e *Executor) executeBitmapSlice(ctx context.Context, index string, c *pql. } // Return an error if both the row and column label are specified. - rowID, rowOK, rowErr := c.UintArg(DefaultRowLabel) - columnID, columnOK, columnErr := c.UintArg(DefaultColumnLabel) + rowID, rowOK, rowErr := c.UintArg(rowLabel) + columnID, columnOK, columnErr := c.UintArg(columnLabel) if rowErr != nil || columnErr != nil { return nil, fmt.Errorf("Bitmap() error with arg for col: %v or row: %v", columnErr, rowErr) } if rowOK && columnOK { - return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", DefaultRowLabel, DefaultColumnLabel) + return nil, fmt.Errorf("Bitmap() cannot specify both %s and %s values", rowLabel, columnLabel) } else if !rowOK && !columnOK { - return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", DefaultRowLabel, DefaultColumnLabel) + return nil, fmt.Errorf("Bitmap() must specify either %s or %s values", rowLabel, columnLabel) } // Determine row or column orientation. @@ -604,11 +607,11 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C } // Read row & column id. - columnID, columnOK, err := c.UintArg(DefaultColumnLabel) + columnID, columnOK, err := c.UintArg(columnLabel) if err != nil { return nil, fmt.Errorf("executeRangeSlice - reading column: %v", err) } - rowID, rowOK, err := c.UintArg(DefaultRowLabel) + rowID, rowOK, err := c.UintArg(rowLabel) if err != nil { return nil, fmt.Errorf("executeRangeSlice - reading row: %v", err) } @@ -617,9 +620,9 @@ func (e *Executor) executeRangeSlice(ctx context.Context, index string, c *pql.C var id uint64 var viewName string if columnOK && rowOK { - return nil, fmt.Errorf("Range() cannot contain both %q and %q", DefaultColumnLabel, DefaultRowLabel) + return nil, fmt.Errorf("Range() cannot contain both %q and %q", columnLabel, rowLabel) } else if !columnOK && !rowOK { - return nil, fmt.Errorf("Range() must specify either %q or %q", DefaultColumnLabel, DefaultRowLabel) + return nil, fmt.Errorf("Range() must specify either %q or %q", columnLabel, rowLabel) } else if columnOK { viewName, id = ViewInverse, columnID } else { @@ -893,18 +896,18 @@ func (e *Executor) executeClearBit(ctx context.Context, index string, c *pql.Cal } // Read fields using labels. - rowID, ok, err := c.UintArg(DefaultRowLabel) + rowID, ok, err := c.UintArg(rowLabel) if err != nil { return false, fmt.Errorf("reading ClearBit() row: %v", err) } else if !ok { - return false, fmt.Errorf("ClearBit() row field '%v' required", DefaultRowLabel) + return false, fmt.Errorf("ClearBit() row field '%v' required", rowLabel) } - colID, ok, err := c.UintArg(DefaultColumnLabel) + colID, ok, err := c.UintArg(columnLabel) if err != nil { return false, fmt.Errorf("reading ClearBit() column: %v", err) } else if !ok { - return false, fmt.Errorf("ClearBit col field '%v' required", DefaultColumnLabel) + return false, fmt.Errorf("ClearBit col field '%v' required", columnLabel) } // Clear bits for each view. @@ -983,18 +986,18 @@ func (e *Executor) executeSetBit(ctx context.Context, index string, c *pql.Call, } // Read fields using labels. - rowID, ok, err := c.UintArg(DefaultRowLabel) + rowID, ok, err := c.UintArg(rowLabel) if err != nil { return false, fmt.Errorf("reading SetBit() row: %v", err) } else if !ok { - return false, fmt.Errorf("SetBit() row field '%v' required", DefaultRowLabel) + return false, fmt.Errorf("SetBit() row field '%v' required", rowLabel) } - colID, ok, err := c.UintArg(DefaultColumnLabel) + colID, ok, err := c.UintArg(columnLabel) if err != nil { return false, fmt.Errorf("reading SetBit() column: %v", err) } else if !ok { - return false, fmt.Errorf("SetBit() column field '%v' required", DefaultColumnLabel) + return false, fmt.Errorf("SetBit() column field '%v' required", columnLabel) } var timestamp *time.Time @@ -1080,11 +1083,11 @@ func (e *Executor) executeSetFieldValue(ctx context.Context, index string, c *pq } // Parse labels. - columnID, ok, err := c.UintArg(DefaultColumnLabel) + columnID, ok, err := c.UintArg(columnLabel) if err != nil { return fmt.Errorf("reading SetFieldValue() column: %v", err) } else if !ok { - return fmt.Errorf("SetFieldValue() column field '%v' required", DefaultColumnLabel) + return fmt.Errorf("SetFieldValue() column field '%v' required", columnLabel) } // Copy args and remove reserved fields. @@ -1092,7 +1095,7 @@ func (e *Executor) executeSetFieldValue(ctx context.Context, index string, c *pq delete(args, "frame") // While frame could technically work as a ColumnAttr argument, we are treating it as a reserved word primarily to avoid confusion. // Also, if we ever need to make ColumnAttrs frame-specific, then having this reserved word prevents backward incompatibility. - delete(args, DefaultColumnLabel) + delete(args, columnLabel) // Set values. for name, value := range args { @@ -1146,17 +1149,17 @@ func (e *Executor) executeSetRowAttrs(ctx context.Context, index string, c *pql. } // Parse labels. - rowID, ok, err := c.UintArg(DefaultRowLabel) + rowID, ok, err := c.UintArg(rowLabel) if err != nil { return fmt.Errorf("reading SetRowAttrs() row: %v", err) } else if !ok { - return fmt.Errorf("SetRowAttrs() row field '%v' required", DefaultRowLabel) + return fmt.Errorf("SetRowAttrs() row field '%v' required", rowLabel) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) delete(attrs, "frame") - delete(attrs, DefaultRowLabel) + delete(attrs, rowLabel) // Set attributes. if err := frame.RowAttrStore().SetAttrs(rowID, attrs); err != nil { @@ -1205,17 +1208,17 @@ func (e *Executor) executeBulkSetRowAttrs(ctx context.Context, index string, cal return nil, ErrFrameNotFound } - rowID, ok, err := c.UintArg(DefaultRowLabel) + rowID, ok, err := c.UintArg(rowLabel) if err != nil { - return nil, fmt.Errorf("reading SetRowAttrs() row: %v", DefaultRowLabel) + return nil, fmt.Errorf("reading SetRowAttrs() row: %v", rowLabel) } else if !ok { - return nil, fmt.Errorf("SetRowAttrs row field '%v' required", DefaultRowLabel) + return nil, fmt.Errorf("SetRowAttrs row field '%v' required", rowLabel) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) delete(attrs, "frame") - delete(attrs, DefaultRowLabel) + delete(attrs, rowLabel) // Create frame group, if not exists. frameMap := m[frame] @@ -1284,14 +1287,14 @@ func (e *Executor) executeSetColumnAttrs(ctx context.Context, index string, c *p return ErrIndexNotFound } - col, okCol, errCol := c.UintArg(DefaultColumnLabel) + col, okCol, errCol := c.UintArg(columnLabel) if errCol != nil || !okCol { return fmt.Errorf("reading SetColumnAttrs() col errs: %v found %v", errCol, okCol) } // Copy args and remove reserved fields. attrs := pql.CopyArgs(c.Args) - delete(attrs, DefaultColumnLabel) + delete(attrs, columnLabel) delete(attrs, "frame") // Set attributes. diff --git a/frame.go b/frame.go index f786ac0b0..b5968a5d3 100644 --- a/frame.go +++ b/frame.go @@ -32,7 +32,6 @@ import ( // Default frame settings. const ( - DefaultRowLabel = "row" DefaultCacheType = CacheTypeRanked DefaultInverseEnabled = false DefaultRangeEnabled = false diff --git a/index.go b/index.go index f17854e1e..0f0cad456 100644 --- a/index.go +++ b/index.go @@ -31,7 +31,6 @@ import ( // Default index settings. const ( - DefaultColumnLabel = "col" InputDefinitionDir = ".input-definitions" ) From ce4fb3c4d347eb66bc0682ca27592e73c2708c87 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Tue, 3 Apr 2018 10:36:48 -0500 Subject: [PATCH 4/4] remove references to rowLabel and columnLabel --- docs/api-reference.md | 4 ++-- docs/query-language.md | 6 +----- handler_internal_test.go | 4 ++-- pilosa.go | 11 ----------- pilosa_test.go | 24 ------------------------ webui/assets/main.js | 4 ++-- webui/index.html | 4 ++-- 7 files changed, 9 insertions(+), 48 deletions(-) diff --git a/docs/api-reference.md b/docs/api-reference.md index 9092c92bc..446235cdc 100644 --- a/docs/api-reference.md +++ b/docs/api-reference.md @@ -215,7 +215,7 @@ The request payload is JSON, and it must contain the fields `frames` and `fields * `cacheType` (string): [ranked](../data-model/#ranked) or [LRU](../data-model/#lru) caching on this frame. Default is `lru`. * `cacheSize` (int): Number of rows to keep in the cache. Default 50,000. -The `fields` array contains a series of JSON objects describing how to process each field received in the input data. Each `field` object must contain a `name` which maps to the source JSON field name. One field must be defined at the `primaryKey`. The `primarykey` source field name must equal the column label for the `Index`, and its value must be an unsigned integer which maps directly to a columnID in Pilosa. +The `fields` array contains a series of JSON objects describing how to process each field received in the input data. Each `field` object must contain a `name` which maps to the source JSON field name. One field must be defined at the `primaryKey`. The `primarykey` source field's value must be an unsigned integer which maps directly to a columnID in Pilosa. * `name` (string): Maps the source data field to actions that process the field's corresponding value. * `actions` (array): List of actions that will process the field's value. @@ -310,7 +310,7 @@ Input definition is deprecated as of v0.9. Processes the JSON payload using the given input definition. -The request payload is a JSON array of objects containing one field for the primary key that corresponds to the column label, and additional fields that will be handled by corresponding actions in the input definition. +The request payload is a JSON array of objects containing one field for the primary key that corresponds to the column, and additional fields that will be handled by corresponding actions in the input definition. ``` request curl localhost:10101/index/user/input/stargazer-input \ diff --git a/docs/query-language.md b/docs/query-language.md index 0ccca3a80..6b0584320 100644 --- a/docs/query-language.md +++ b/docs/query-language.md @@ -21,8 +21,6 @@ This section will provide a detailed reference and examples for the Pilosa Query There will be one item in the `results` array for each PQL query in the request. The type of each item in the array will depend on the type of query - each query in the reference below lists it's result type. -The default row label is `rowID`, and the default column label is `columnID`. Changing these defaults is deprecated and this feature will be removed in a future release. - #### Conventions * Angle Brackets `<>` denote required arguments @@ -46,8 +44,6 @@ curl localhost:10101/index/repository/query \ #### Arguments and Types * `frame` The frame specifies on which Pilosa [frame](../glossary/#frame) the query will operate. Valid frame names are lower case strings; they start with an alphanumeric character, and contain only alphanumeric characters and `_-`. They must be 64 characters or less in length. -* `ROW_LABEL` The default row label is `rowID`, changing the default is deprecated. -* `COL_LABEL` The default column label is `columnID`, changing the default is deprecated. * `TIMESTAMP` This is a timestamp in quotes with the following format `"YYYY-MM-DDTHH:MM"` (e.g. "2006-01-02T15:04") * `UINT` An unsigned integer (e.g. 42839) * `ATTR_NAME` Must be a valid identifier `[A-Za-z][A-Za-z0-9._-]*` @@ -223,7 +219,7 @@ Bitmap(, ( | =UINT)) **Description:** -`Bitmap` retrieves the indices of all the set bits in a row or column based on whether the row label or column label is given in the query. It also retrieves any attributes set on that row or column. +`Bitmap` retrieves the indices of all the set bits in a row or column based on whether the row or column argument is provided in the query. It also retrieves any attributes set on that row or column. **Result Type:** object with attrs and bits. diff --git a/handler_internal_test.go b/handler_internal_test.go index 395ec73b6..4603662e6 100644 --- a/handler_internal_test.go +++ b/handler_internal_test.go @@ -30,7 +30,7 @@ func TestPostIndexRequestUnmarshalJSON(t *testing.T) { {json: `{"options": {}}`, expected: postIndexRequest{Options: IndexOptions{}}}, {json: `{"options": 4}`, err: "options is not map[string]interface{}"}, {json: `{"option": {}}`, err: "Unknown key: option:map[]"}, - {json: `{"options": {"columnLabel": "test"}}`, err: "Unknown key: columnLabel:test"}, + {json: `{"options": {"badKey": "test"}}`, err: "Unknown key: badKey:test"}, } for _, test := range tests { actual := &postIndexRequest{} @@ -65,7 +65,7 @@ func TestPostFrameRequestUnmarshalJSON(t *testing.T) { {json: `{"options": {}}`, expected: postFrameRequest{Options: FrameOptions{}}}, {json: `{"options": 4}`, err: "options is not map[string]interface{}"}, {json: `{"option": {}}`, err: "Unknown key: option:map[]"}, - {json: `{"options": {"rowLabel": "test"}}`, err: "Unknown key: rowLabel:test"}, + {json: `{"options": {"badKey": "test"}}`, err: "Unknown key: badKey:test"}, {json: `{"options": {"inverseEnabled": true}}`, expected: postFrameRequest{Options: FrameOptions{InverseEnabled: true}}}, {json: `{"options": {"inverseEnabled": true, "cacheType": "type"}}`, expected: postFrameRequest{Options: FrameOptions{InverseEnabled: true, CacheType: "type"}}}, {json: `{"options": {"inverse": true, "cacheType": "type"}}`, err: "Unknown key: inverse:true"}, diff --git a/pilosa.go b/pilosa.go index a3e11b826..8f1ae287e 100644 --- a/pilosa.go +++ b/pilosa.go @@ -77,9 +77,6 @@ var ( // Regular expression to validate index and frame names. var nameRegexp = regexp.MustCompile(`^[a-z][a-z0-9_-]{0,63}$`) -// Regular expression to validate row and column labels. -var labelRegexp = regexp.MustCompile(`^[A-Za-z][A-Za-z0-9_-]{0,63}$`) - // ColumnAttrSet represents a set of attributes for a vertical column in an index. // Can have a set of attributes attached to it. type ColumnAttrSet struct { @@ -141,14 +138,6 @@ func ValidateName(name string) error { return nil } -// ValidateLabel ensures that the label is a valid format. -func ValidateLabel(label string) error { - if labelRegexp.Match([]byte(label)) == false { - return ErrLabel - } - return nil -} - // StringInSlice checks for substring a in the slice. func StringInSlice(a string, list []string) bool { for _, b := range list { diff --git a/pilosa_test.go b/pilosa_test.go index d82e27fa3..41b0d7098 100644 --- a/pilosa_test.go +++ b/pilosa_test.go @@ -46,30 +46,6 @@ func TestValidateNameInvalid(t *testing.T) { } } -func TestValidateLabel(t *testing.T) { - labels := []string{ - "a", "ab", "ab1", "d_e", "A", "Bc", "B1", "aB", "b-c", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - } - for _, label := range labels { - if pilosa.ValidateLabel(label) != nil { - t.Fatalf("Should be valid label: %s", label) - } - } -} - -func TestValidateLabelInvalid(t *testing.T) { - labels := []string{ - "", "1", "_", "-", "'", "^", "/", "\\", "*", "a:b", "valid?no", "yüce", - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1", - } - for _, label := range labels { - if pilosa.ValidateLabel(label) == nil { - t.Fatalf("Should be invalid label: %s", label) - } - } -} - func TestStringInSlice(t *testing.T) { list := []string{"localhost:10101", "localhost:10102", "localhost:10103"} substr := "localhost:10101" diff --git a/webui/assets/main.js b/webui/assets/main.js index 6a4415a5c..c0a24bdf6 100644 --- a/webui/assets/main.js +++ b/webui/assets/main.js @@ -472,7 +472,7 @@ class Autocompleter { } init_dynamic_keywords() { - // hit /schema, parse indexes, frames, rowlabels, columnlabels, add to list + // hit /schema, parse indexes, frames, add to list } add_keyword() { @@ -583,4 +583,4 @@ function parse_options(option_str) { } } return options; -} \ No newline at end of file +} diff --git a/webui/index.html b/webui/index.html index dc06e310a..75eaa1d5a 100644 --- a/webui/index.html +++ b/webui/index.html @@ -55,9 +55,9 @@
Special commands
- :create index test [columnLabel=column]
+ :create index test
:use test
- :create frame foo [rowLabel=row]
+ :create frame foo
:delete index test
:delete frame foo