Skip to content

Commit 2df34d7

Browse files
committed
ESQL: Hide some "extras" from docs
Hides some of the "extra" lines from ESQL's documentation. These lines are required to make the documentation into nice tests which is important to make sure the docs don't get out of date. But readers don't need to see them.
1 parent cac356a commit 2df34d7

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/bucket.csv-spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ bucketMonthInAgg#[skip:-8.13.99, reason:BUCKET renamed in 8.14]
130130
FROM employees
131131
| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"
132132
| STATS AVG(salary) BY bucket = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")
133-
| SORT bucket
134133
// end::bucket_in_agg[]
134+
| SORT bucket
135135
;
136136

137137
// tag::bucket_in_agg-result[]
@@ -150,9 +150,9 @@ bucketWithOffset#[skip:-8.13.99, reason:BUCKET renamed in 8.14]
150150
FROM employees
151151
| STATS dates = MV_SORT(VALUES(birth_date)) BY b = BUCKET(birth_date + 1 HOUR, 1 YEAR) - 1 HOUR
152152
| EVAL d_count = MV_COUNT(dates)
153+
// end::bucketWithOffset[]
153154
| SORT d_count, b
154155
| LIMIT 3
155-
// end::bucketWithOffset[]
156156
;
157157

158158
// tag::bucketWithOffset-result[]
@@ -168,8 +168,8 @@ docsBucketMonth#[skip:-8.13.99, reason:BUCKET renamed in 8.14]
168168
FROM employees
169169
| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"
170170
| STATS hire_date = MV_SORT(VALUES(hire_date)) BY month = BUCKET(hire_date, 20, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")
171-
| SORT hire_date
172171
//end::docsBucketMonth[]
172+
| SORT hire_date
173173
;
174174

175175
//tag::docsBucketMonth-result[]
@@ -208,8 +208,8 @@ docsBucketWeeklyHistogram#[skip:-8.13.99, reason:BUCKET renamed in 8.14]
208208
FROM employees
209209
| WHERE hire_date >= "1985-01-01T00:00:00Z" AND hire_date < "1986-01-01T00:00:00Z"
210210
| STATS hires_per_week = COUNT(*) BY week = BUCKET(hire_date, 100, "1985-01-01T00:00:00Z", "1986-01-01T00:00:00Z")
211-
| SORT week
212211
//end::docsBucketWeeklyHistogram[]
212+
| SORT week
213213
;
214214

215215
//tag::docsBucketWeeklyHistogram-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/inlinestats.csv-spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ FROM employees
99
| KEEP emp_no, languages
1010
| INLINESTATS max_lang = MAX(languages)
1111
| WHERE max_lang == languages
12+
// end::max-languages[]
1213
| SORT emp_no ASC
1314
| LIMIT 5
14-
// end::max-languages[]
1515
;
1616

1717
// tag::max-languages-result[]
@@ -78,9 +78,9 @@ FROM employees
7878
| KEEP emp_no, avg_worked_seconds, last_name
7979
| INLINESTATS max_avg_worked_seconds = MAX(avg_worked_seconds) BY SUBSTRING(last_name, 0, 1)
8080
| WHERE max_avg_worked_seconds == avg_worked_seconds
81+
// end::longest-tenured-by-first[]
8182
| SORT last_name ASC
8283
| LIMIT 5
83-
// end::longest-tenured-by-first[]
8484
;
8585

8686
// tag::longest-tenured-by-first-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/kql-function.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ required_capability: kql_function
88
// tag::kql-with-field[]
99
FROM books
1010
| WHERE KQL("author: Faulkner")
11+
// end::kql-with-field[]
1112
| KEEP book_no, author
1213
| SORT book_no
1314
| LIMIT 5
14-
// end::kql-with-field[]
1515
;
1616

1717
// tag::kql-with-field-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-function.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ required_capability: match_function
88
// tag::match-with-field[]
99
FROM books
1010
| WHERE MATCH(author, "Faulkner")
11+
// end::match-with-field[]
1112
| KEEP book_no, author
1213
| SORT book_no
1314
| LIMIT 5
14-
// end::match-with-field[]
1515
;
1616

1717
// tag::match-with-field-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/match-operator.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ required_capability: match_operator_colon
88
// tag::match-with-field[]
99
FROM books
1010
| WHERE author:"Faulkner"
11+
// end::match-with-field[]
1112
| KEEP book_no, author
1213
| SORT book_no
1314
| LIMIT 5
14-
// end::match-with-field[]
1515
;
1616

1717
// tag::match-with-field-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/null.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ isNullForDocs
2828
// tag::is-null[]
2929
FROM employees
3030
| WHERE birth_date IS NULL
31+
// end::is-null[]
3132
| KEEP first_name, last_name
3233
| SORT first_name
3334
| LIMIT 3
34-
// end::is-null[]
3535
;
3636

3737
// tag::is-null-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/qstr-function.csv-spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ required_capability: qstr_function
88
// tag::qstr-with-field[]
99
FROM books
1010
| WHERE QSTR("author: Faulkner")
11+
// end::qstr-with-field[]
1112
| KEEP book_no, author
1213
| SORT book_no
1314
| LIMIT 5
14-
// end::qstr-with-field[]
1515
;
1616

1717
// tag::qstr-with-field-result[]
@@ -196,10 +196,10 @@ required_capability: query_string_function_options
196196
// tag::qstr-with-options[]
197197
FROM books
198198
| WHERE QSTR("title: Hobbjt~", {"fuzziness": 2})
199+
// end::qstr-with-options[]
199200
| KEEP book_no, title
200201
| SORT book_no
201202
| LIMIT 5
202-
// end::qstr-with-options[]
203203
;
204204
ignoreOrder: true
205205

x-pack/plugin/esql/qa/testFixtures/src/main/resources/string.csv-spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,9 +1132,9 @@ left
11321132
FROM employees
11331133
| KEEP last_name
11341134
| EVAL left = LEFT(last_name, 3)
1135+
// end::left[]
11351136
| SORT last_name ASC
11361137
| LIMIT 5
1137-
// end::left[]
11381138
;
11391139

11401140
// tag::left-result[]
@@ -1152,9 +1152,9 @@ right
11521152
FROM employees
11531153
| KEEP last_name
11541154
| EVAL right = RIGHT(last_name, 3)
1155+
// end::right[]
11551156
| SORT last_name ASC
11561157
| LIMIT 5
1157-
// end::right[]
11581158
;
11591159

11601160
// tag::right-result[]

x-pack/plugin/esql/qa/testFixtures/src/main/resources/term-function.csv-spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ required_capability: term_function
88
// tag::term-with-field[]
99
FROM books
1010
| WHERE TERM(author, "gabriel")
11+
// end::term-with-field[]
1112
| KEEP book_no, title
1213
| LIMIT 3;
13-
// end::term-with-field[]
1414
ignoreOrder:true
1515

1616
book_no:keyword | title:text

0 commit comments

Comments
 (0)