Skip to content

Commit addacee

Browse files
committed
[DOCS] Remove unneeded options from [source,sql] code blocks (#42759)
In AsciiDoc, `subs="attributes,callouts,macros"` options were required to render `include-tagged::` in a code block. With elastic/docs#827, Elasticsearch Reference documentation migrated from AsciiDoc to Asciidoctor. In Asciidoctor, the `subs="attributes,callouts,macros"` options are no longer needed to render `include-tagged::` in a code block. This commit removes those unneeded options. Resolves #41589
1 parent 2a85829 commit addacee

File tree

6 files changed

+39
-39
lines changed

6 files changed

+39
-39
lines changed

docs/reference/sql/language/syntax/describe-table.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DESC table
2121

2222
`DESC` and `DESCRIBE` are aliases to <<sql-syntax-show-columns>>.
2323

24-
["source","sql",subs="attributes,callouts,macros"]
24+
[source, sql]
2525
----
2626
include-tagged::{sql-specs}/docs.csv-spec[describeTable]
2727
----

docs/reference/sql/language/syntax/select.asciidoc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The general execution of `SELECT` is as follows:
3636

3737
As with a table, every output column of a `SELECT` has a name which can be either specified per column through the `AS` keyword :
3838

39-
["source","sql",subs="attributes,callouts,macros"]
39+
[source, sql]
4040
----
4141
include-tagged::{sql-specs}/docs.csv-spec[selectColumnAlias]
4242
----
@@ -46,14 +46,14 @@ which is why it is recommended to specify it.
4646

4747
assigned by {es-sql} if no name is given:
4848

49-
["source","sql",subs="attributes,callouts,macros"]
49+
[source, sql]
5050
----
5151
include-tagged::{sql-specs}/docs.csv-spec[selectInline]
5252
----
5353

5454
or if it's a simple column reference, use its name as the column name:
5555

56-
["source","sql",subs="attributes,callouts,macros"]
56+
[source, sql]
5757
----
5858
include-tagged::{sql-specs}/docs.csv-spec[selectColumn]
5959
----
@@ -63,7 +63,7 @@ include-tagged::{sql-specs}/docs.csv-spec[selectColumn]
6363

6464
To select all the columns in the source, one can use `*`:
6565

66-
["source","sql",subs="attributes,callouts,macros"]
66+
[source, sql]
6767
----
6868
include-tagged::{sql-specs}/docs.csv-spec[wildcardWithOrder]
6969
----
@@ -90,22 +90,22 @@ Represents the name (optionally qualified) of an existing table, either a concre
9090

9191
If the table name contains special SQL characters (such as `.`,`-`,etc...) use double quotes to escape them:
9292

93-
["source","sql",subs="attributes,callouts,macros"]
93+
[source, sql]
9494
----
9595
include-tagged::{sql-specs}/docs.csv-spec[fromTableQuoted]
9696
----
9797

9898
The name can be a <<multi-index, pattern>> pointing to multiple indices (likely requiring quoting as mentioned above) with the restriction that *all* resolved concrete tables have **exact mapping**.
9999

100-
["source","sql",subs="attributes,callouts,macros"]
100+
[source, sql]
101101
----
102102
include-tagged::{sql-specs}/docs.csv-spec[fromTablePatternQuoted]
103103
----
104104

105105
`alias`::
106106
A substitute name for the `FROM` item containing the alias. An alias is used for brevity or to eliminate ambiguity. When an alias is provided, it completely hides the actual name of the table and must be used in its place.
107107

108-
["source","sql",subs="attributes,callouts,macros"]
108+
[source, sql]
109109
----
110110
include-tagged::{sql-specs}/docs.csv-spec[fromTableAlias]
111111
----
@@ -127,7 +127,7 @@ where:
127127

128128
Represents an expression that evaluates to a `boolean`. Only the rows that match the condition (to `true`) are returned.
129129

130-
["source","sql",subs="attributes,callouts,macros"]
130+
[source, sql]
131131
----
132132
include-tagged::{sql-specs}/docs.csv-spec[basicWhere]
133133
----
@@ -151,34 +151,34 @@ Represents an expression on which rows are being grouped _on_. It can be a colum
151151

152152
A common, group by column name:
153153

154-
["source","sql",subs="attributes,callouts,macros"]
154+
[source, sql]
155155
----
156156
include-tagged::{sql-specs}/docs.csv-spec[groupByColumn]
157157
----
158158

159159
Grouping by output ordinal:
160160

161-
["source","sql",subs="attributes,callouts,macros"]
161+
[source, sql]
162162
----
163163
include-tagged::{sql-specs}/docs.csv-spec[groupByOrdinal]
164164
----
165165

166166
Grouping by alias:
167167

168-
["source","sql",subs="attributes,callouts,macros"]
168+
[source, sql]
169169
----
170170
include-tagged::{sql-specs}/docs.csv-spec[groupByAlias]
171171
----
172172

173173
And grouping by column expression (typically used along-side an alias):
174174

175-
["source","sql",subs="attributes,callouts,macros"]
175+
[source, sql]
176176
----
177177
include-tagged::{sql-specs}/docs.csv-spec[groupByExpression]
178178
----
179179

180180
Or a mixture of the above:
181-
["source","sql",subs="attributes,callouts,macros"]
181+
[source, sql]
182182
----
183183
include-tagged::{sql-specs}/docs.csv-spec[groupByMulti]
184184
----
@@ -188,21 +188,21 @@ When a `GROUP BY` clause is used in a `SELECT`, _all_ output expressions must be
188188

189189
To wit:
190190

191-
["source","sql",subs="attributes,callouts,macros"]
191+
[source, sql]
192192
----
193193
include-tagged::{sql-specs}/docs.csv-spec[groupByAndAgg]
194194
----
195195

196196
Expressions over aggregates used in output:
197197

198-
["source","sql",subs="attributes,callouts,macros"]
198+
[source, sql]
199199
----
200200
include-tagged::{sql-specs}/docs.csv-spec[groupByAndAggExpression]
201201
----
202202

203203
Multiple aggregates used:
204204

205-
["source","sql",subs="attributes,callouts,macros"]
205+
[source, sql]
206206
----
207207
include-tagged::{sql-specs}/docs.csv-spec[groupByAndMultipleAggs]
208208
----
@@ -216,14 +216,14 @@ As such, the query emits only a single row (as there is only a single group).
216216

217217
A common example is counting the number of records:
218218

219-
["source","sql",subs="attributes,callouts,macros"]
219+
[source, sql]
220220
----
221221
include-tagged::{sql-specs}/docs.csv-spec[groupByImplicitCount]
222222
----
223223

224224
Of course, multiple aggregations can be applied:
225225

226-
["source","sql",subs="attributes,callouts,macros"]
226+
[source, sql]
227227
----
228228
include-tagged::{sql-specs}/docs.csv-spec[groupByImplicitMultipleAggs]
229229
----
@@ -250,14 +250,14 @@ Both `WHERE` and `HAVING` are used for filtering however there are several signi
250250
. `WHERE` works on individual *rows*, `HAVING` works on the *groups* created by ``GROUP BY``
251251
. `WHERE` is evaluated *before* grouping, `HAVING` is evaluated *after* grouping
252252

253-
["source","sql",subs="attributes,callouts,macros"]
253+
[source, sql]
254254
----
255255
include-tagged::{sql-specs}/docs.csv-spec[groupByHaving]
256256
----
257257

258258
Further more, one can use multiple aggregate expressions inside `HAVING` even ones that are not used in the output (`SELECT`):
259259

260-
["source","sql",subs="attributes,callouts,macros"]
260+
[source, sql]
261261
----
262262
include-tagged::{sql-specs}/docs.csv-spec[groupByHavingMultiple]
263263
----
@@ -271,14 +271,14 @@ As such, the query emits only a single row (as there is only a single group) and
271271

272272
In this example, `HAVING` matches:
273273

274-
["source","sql",subs="attributes,callouts,macros"]
274+
[source, sql]
275275
----
276276
include-tagged::{sql-specs}/docs.csv-spec[groupByHavingImplicitMatch]
277277
----
278278

279279
//However `HAVING` can also not match, in which case an empty result is returned:
280280
//
281-
//["source","sql",subs="attributes,callouts,macros"]
281+
//[source, sql]
282282
//----
283283
//include-tagged::{sql-specs}/docs.csv-spec[groupByHavingImplicitNoMatch]
284284
//----
@@ -307,7 +307,7 @@ IMPORTANT: When used along-side, `GROUP BY` expression can point _only_ to the c
307307
308308
For example, the following query sorts by an arbitrary input field (`page_count`):
309309
310-
["source","sql",subs="attributes,callouts,macros"]
310+
[source, sql]
311311
----
312312
include-tagged::{sql-specs}/docs.csv-spec[orderByBasic]
313313
----
@@ -324,15 +324,15 @@ combined using the same rules as {es}'s
324324
325325
To sort based on the `score`, use the special function `SCORE()`:
326326
327-
["source","sql",subs="attributes,callouts,macros"]
327+
[source, sql]
328328
----
329329
include-tagged::{sql-specs}/docs.csv-spec[orderByScore]
330330
----
331331
332332
Note that you can return `SCORE()` by using a full-text search predicate in the `WHERE` clause.
333333
This is possible even if `SCORE()` is not used for sorting:
334334
335-
["source","sql",subs="attributes,callouts,macros"]
335+
[source, sql]
336336
----
337337
include-tagged::{sql-specs}/docs.csv-spec[orderByScoreWithMatch]
338338
----
@@ -360,7 +360,7 @@ ALL:: indicates there is no limit and thus all results are being returned.
360360
361361
To return
362362
363-
["source","sql",subs="attributes,callouts,macros"]
363+
[source, sql]
364364
----
365365
include-tagged::{sql-specs}/docs.csv-spec[limitBasic]
366366
----

docs/reference/sql/language/syntax/show-columns.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SHOW COLUMNS [ FROM | IN ] ? table
1313

1414
List the columns in table and their data type (and other attributes).
1515

16-
["source","sql",subs="attributes,callouts,macros"]
16+
[source, sql]
1717
----
1818
include-tagged::{sql-specs}/docs.csv-spec[showColumns]
1919
----

docs/reference/sql/language/syntax/show-functions.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ SHOW FUNCTIONS [ LIKE? pattern? ]? <1>
1515

1616
List all the SQL functions and their type. The `LIKE` clause can be used to restrict the list of names to the given pattern.
1717

18-
["source","sql",subs="attributes,callouts,macros"]
18+
[source, sql]
1919
----
2020
include-tagged::{sql-specs}/docs.csv-spec[showFunctions]
2121
----
2222

2323
The list of functions returned can be customized based on the pattern.
2424

2525
It can be an exact match:
26-
["source","sql",subs="attributes,callouts,macros"]
26+
[source, sql]
2727
----
2828
include-tagged::{sql-specs}/docs.csv-spec[showFunctionsLikeExact]
2929
----
3030

3131
A wildcard for exactly one character:
32-
["source","sql",subs="attributes,callouts,macros"]
32+
[source, sql]
3333
----
3434
include-tagged::{sql-specs}/docs.csv-spec[showFunctionsLikeChar]
3535
----
3636

3737
A wildcard matching zero or more characters:
38-
["source","sql",subs="attributes,callouts,macros"]
38+
[source, sql]
3939
----
4040
include-tagged::{sql-specs}/docs.csv-spec[showFunctionsLikeWildcard]
4141
----
4242

4343
Or of course, a variation of the above:
44-
["source","sql",subs="attributes,callouts,macros"]
44+
[source, sql]
4545
----
4646
include-tagged::{sql-specs}/docs.csv-spec[showFunctionsWithPattern]
4747
----

docs/reference/sql/language/syntax/show-tables.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@ SHOW TABLES [ LIKE? pattern? ]? <1>
1515

1616
List the tables available to the current user and their type.
1717

18-
["source","sql",subs="attributes,callouts,macros"]
18+
[source, sql]
1919
----
2020
include-tagged::{sql-specs}/docs.csv-spec[showTables]
2121
----
2222

2323
The `LIKE` clause can be used to restrict the list of names to the given pattern.
2424

2525
The pattern can be an exact match:
26-
["source","sql",subs="attributes,callouts,macros"]
26+
[source, sql]
2727
----
2828
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeExact]
2929
----
3030

3131
Multiple chars:
32-
["source","sql",subs="attributes,callouts,macros"]
32+
[source, sql]
3333
----
3434
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeWildcard]
3535
----
3636

3737
A single char:
38-
["source","sql",subs="attributes,callouts,macros"]
38+
[source, sql]
3939
----
4040
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeOneChar]
4141
----
4242

4343

4444
Or a mixture of single and multiple chars:
45-
["source","sql",subs="attributes,callouts,macros"]
45+
[source, sql]
4646
----
4747
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeMixed]
4848
----

docs/reference/sql/security.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ the API require `cluster:monitor/main`.
3333
The following example configures a role that can run SQL in JDBC querying the `test` and `bort`
3434
indices:
3535

36-
["source","yaml",subs="attributes,callouts,macros"]
36+
[source, yaml]
3737
--------------------------------------------------
3838
include-tagged::{sql-tests}/security/roles.yml[cli_jdbc]
3939
--------------------------------------------------

0 commit comments

Comments
 (0)