From cf85a08596559cb4691e314fb45906c540c2e0a7 Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Mon, 13 Nov 2017 18:15:15 -0600 Subject: [PATCH 1/2] Add search-friendly documentation for BSI range query syntax --- docs/query-language.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/query-language.md b/docs/query-language.md index 2a8130736..8d39f818a 100644 --- a/docs/query-language.md +++ b/docs/query-language.md @@ -427,7 +427,7 @@ Returns `{{"attrs":{},"bits":[10]}` **Spec:** ``` -Range(, ) +Range(, ) ``` **Description:** @@ -441,7 +441,7 @@ Returns bits that are true for the comparison operator. **Examples:** In our source data, commitactivity was counted over the last year. -The following Range query returns all repositories having more than 100 commits. +The following greater-than (GT) Range query returns all repositories having more than 100 commits. ``` Range(frame="stats", commitactivity > 100) @@ -451,6 +451,13 @@ Returns `{{"attrs":{},"bits":[10]}` * bits are repositories which had at least 100 commits in the last year. +Similar syntax is supported for less-than (LT or `<`), less-than-or-equal (LTE or `<=`), and greater-than-or-equal (GTE or `>=`). An interval with both bounds can be specified with the "BETWEEN" operator `><`, and a two-element list containing the lower and upper bounds of the interval: + +``` +Range(frame="stats", commitactivity >< [100, 200]) +``` + +This is conceptually equivalent to the interval 100 < commitactivity < 200, but this chained comparison syntax is not currently supported. BETWEEN queries syntax is restricted to greater-than and less-than, but any valid interval on the integers can be represented this way. #### Sum @@ -499,4 +506,4 @@ SetFieldValue returns `null` upon success. Set the number of pull requests of repository 10. ``` SetFieldValue(col=10, frame="stats", pullrequests=2) -``` \ No newline at end of file +``` From 52c0676d34ed3c01dd8dc8166f30d0dc5332798d Mon Sep 17 00:00:00 2001 From: Alan Bernstein Date: Tue, 14 Nov 2017 10:28:25 -0600 Subject: [PATCH 2/2] BSI Range doc updates --- docs/query-language.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/query-language.md b/docs/query-language.md index 8d39f818a..f28257fe6 100644 --- a/docs/query-language.md +++ b/docs/query-language.md @@ -441,7 +441,7 @@ Returns bits that are true for the comparison operator. **Examples:** In our source data, commitactivity was counted over the last year. -The following greater-than (GT) Range query returns all repositories having more than 100 commits. +The following greater-than Range query returns all repositories having more than 100 commits. ``` Range(frame="stats", commitactivity > 100) @@ -451,13 +451,25 @@ Returns `{{"attrs":{},"bits":[10]}` * bits are repositories which had at least 100 commits in the last year. -Similar syntax is supported for less-than (LT or `<`), less-than-or-equal (LTE or `<=`), and greater-than-or-equal (GTE or `>=`). An interval with both bounds can be specified with the "BETWEEN" operator `><`, and a two-element list containing the lower and upper bounds of the interval: +BSI range queries support the following operators: + + Operator | Name | Value +----------|-------------------------------|-------------------- + `>` | greater-than, GT | integer + `<` | less-than, LT | integer + `<=` | less-than-or-equal-to, LTE | integer + `>=` | greater-than-or-equal-to, GTE | integer + `==` | equal-to, EQ | integer + `!=` | not-equal-to, NEQ | integer or `null` + `><` | between, BETWEEN | [integer, integer] + +The `BETWEEN` query specifies an interval with both bounds, using `><` operator, and a two-element list containing the lower and upper bounds of the interval: ``` Range(frame="stats", commitactivity >< [100, 200]) ``` -This is conceptually equivalent to the interval 100 < commitactivity < 200, but this chained comparison syntax is not currently supported. BETWEEN queries syntax is restricted to greater-than and less-than, but any valid interval on the integers can be represented this way. +This is conceptually equivalent to the interval 100 <= commitactivity <= 200, but this chained comparison syntax is not currently supported. `BETWEEN` query syntax is restricted to greater-than-or-equal-to and less-than-or-equal-to, but any valid interval on the integers can be represented this way. #### Sum