Skip to content

Commit 7b39ab2

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 924eb1a commit 7b39ab2

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
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: 25 additions & 25 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,28 +151,28 @@ 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
----
@@ -181,21 +181,21 @@ When a `GROUP BY` clause is used in a `SELECT`, _all_ output expressions must be
181181

182182
To wit:
183183

184-
["source","sql",subs="attributes,callouts,macros"]
184+
[source, sql]
185185
----
186186
include-tagged::{sql-specs}/docs.csv-spec[groupByAndAgg]
187187
----
188188

189189
Expressions over aggregates used in output:
190190

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

196196
Multiple aggregates used:
197197

198-
["source","sql",subs="attributes,callouts,macros"]
198+
[source, sql]
199199
----
200200
include-tagged::{sql-specs}/docs.csv-spec[groupByAndMultipleAggs]
201201
----
@@ -209,14 +209,14 @@ As such, the query emits only a single row (as there is only a single group).
209209

210210
A common example is counting the number of records:
211211

212-
["source","sql",subs="attributes,callouts,macros"]
212+
[source, sql]
213213
----
214214
include-tagged::{sql-specs}/docs.csv-spec[groupByImplicitCount]
215215
----
216216

217217
Of course, multiple aggregations can be applied:
218218

219-
["source","sql",subs="attributes,callouts,macros"]
219+
[source, sql]
220220
----
221221
include-tagged::{sql-specs}/docs.csv-spec[groupByImplicitMultipleAggs]
222222
----
@@ -243,14 +243,14 @@ Both `WHERE` and `HAVING` are used for filtering however there are several signi
243243
. `WHERE` works on individual *rows*, `HAVING` works on the *groups* created by ``GROUP BY``
244244
. `WHERE` is evaluated *before* grouping, `HAVING` is evaluated *after* grouping
245245

246-
["source","sql",subs="attributes,callouts,macros"]
246+
[source, sql]
247247
----
248248
include-tagged::{sql-specs}/docs.csv-spec[groupByHaving]
249249
----
250250

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

253-
["source","sql",subs="attributes,callouts,macros"]
253+
[source, sql]
254254
----
255255
include-tagged::{sql-specs}/docs.csv-spec[groupByHavingMultiple]
256256
----
@@ -264,14 +264,14 @@ As such, the query emits only a single row (as there is only a single group) and
264264

265265
In this example, `HAVING` matches:
266266

267-
["source","sql",subs="attributes,callouts,macros"]
267+
[source, sql]
268268
----
269269
include-tagged::{sql-specs}/docs.csv-spec[groupByHavingImplicitMatch]
270270
----
271271

272272
//However `HAVING` can also not match, in which case an empty result is returned:
273273
//
274-
//["source","sql",subs="attributes,callouts,macros"]
274+
//[source, sql]
275275
//----
276276
//include-tagged::{sql-specs}/docs.csv-spec[groupByHavingImplicitNoMatch]
277277
//----
@@ -300,7 +300,7 @@ IMPORTANT: When used along-side, `GROUP BY` expression can point _only_ to the c
300300
301301
For example, the following query sorts by an arbitrary input field (`page_count`):
302302
303-
["source","sql",subs="attributes,callouts,macros"]
303+
[source, sql]
304304
----
305305
include-tagged::{sql-specs}/docs.csv-spec[orderByBasic]
306306
----
@@ -317,15 +317,15 @@ combined using the same rules as {es}'s
317317
318318
To sort based on the `score`, use the special function `SCORE()`:
319319
320-
["source","sql",subs="attributes,callouts,macros"]
320+
[source, sql]
321321
----
322322
include-tagged::{sql-specs}/docs.csv-spec[orderByScore]
323323
----
324324
325325
Note that you can return `SCORE()` by using a full-text search predicate in the `WHERE` clause.
326326
This is possible even if `SCORE()` is not used for sorting:
327327
328-
["source","sql",subs="attributes,callouts,macros"]
328+
[source, sql]
329329
----
330330
include-tagged::{sql-specs}/docs.csv-spec[orderByScoreWithMatch]
331331
----
@@ -353,7 +353,7 @@ ALL:: indicates there is no limit and thus all results are being returned.
353353
354354
To return
355355
356-
["source","sql",subs="attributes,callouts,macros"]
356+
[source, sql]
357357
----
358358
include-tagged::{sql-specs}/docs.csv-spec[limitBasic]
359359
----

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)