From ce4fb3c4d347eb66bc0682ca27592e73c2708c87 Mon Sep 17 00:00:00 2001 From: Travis Turner Date: Tue, 3 Apr 2018 10:36:48 -0500 Subject: [PATCH] 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