Skip to content

Commit

Permalink
[DOCS] Remove unneeded options from [source,sql] code blocks (#42759)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jrodewig committed May 31, 2019
1 parent 26bb244 commit 4c6944f
Show file tree
Hide file tree
Showing 16 changed files with 139 additions and 140 deletions.
28 changes: 14 additions & 14 deletions docs/reference/sql/functions/conditional.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[coalesceReturnNonNull]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[coalesceReturnNull]
----
Expand Down Expand Up @@ -79,12 +79,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[ifNullReturnFirst]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[ifNullReturnSecond]
----
Expand Down Expand Up @@ -118,12 +118,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[isNullReturnFirst]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[isNullReturnSecond]
----
Expand Down Expand Up @@ -157,12 +157,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[nvlReturnFirst]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[nvlReturnSecond]
----
Expand Down Expand Up @@ -194,12 +194,12 @@ Returns `null` when the two input expressions are equal and
if not, it returns the 1st expression.


["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[nullIfReturnFirst]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[nullIfReturnNull]
----
Expand Down Expand Up @@ -239,12 +239,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[greatestReturnNonNull]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[greatestReturnNull]
----
Expand Down Expand Up @@ -284,12 +284,12 @@ If all arguments are null, then it returns `null`.



["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[leastReturnNonNull]
----

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[leastReturnNull]
----
58 changes: 29 additions & 29 deletions docs/reference/sql/functions/date-time.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,32 +59,32 @@ s|Description

Basic arithmetic operators (`+`, `-`, etc) support date-time parameters as indicated below:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtIntervalPlusInterval]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtDatePlusInterval]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtMinusInterval]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtIntervalMinusInterval]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtDateMinusInterval]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dtIntervalMul]
--------------------------------------------------
Expand Down Expand Up @@ -117,25 +117,25 @@ parameter for rounding the second fractional digits (nanoseconds).

This method always returns the same value within a query.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[curTs]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[curTsFunction]
--------------------------------------------------

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[curTsFunctionPrecision]
--------------------------------------------------

Typically, this function (as well as its twin <<sql-functions-now,NOW())>> function is used for
relative date/time filtering:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[filterNow]
--------------------------------------------------
Expand Down Expand Up @@ -163,7 +163,7 @@ DAY_OF_MONTH(date_exp) <1>

Extract the day of the month from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dayOfMonth]
--------------------------------------------------
Expand All @@ -187,7 +187,7 @@ DAY_OF_WEEK(date_exp) <1>

Extract the day of the week from a date. Sunday is `1`, Monday is `2`, etc.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dayOfWeek]
--------------------------------------------------
Expand All @@ -211,7 +211,7 @@ DAY_OF_YEAR(date_exp) <1>

Extract the day of the year from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dayOfYear]
--------------------------------------------------
Expand All @@ -235,7 +235,7 @@ DAY_NAME(date_exp) <1>

Extract the day of the week from a datetime in text format (`Monday`, `Tuesday`...).

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dayName]
--------------------------------------------------
Expand All @@ -259,7 +259,7 @@ HOUR_OF_DAY(date_exp) <1>

Extract the hour of the day from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[hourOfDay]
--------------------------------------------------
Expand All @@ -284,7 +284,7 @@ ISO_DAY_OF_WEEK(date_exp) <1>
Extract the day of the week from a date, following the https://en.wikipedia.org/wiki/ISO_week_date[ISO 8601 standard].
Monday is `1`, Tuesday is `2`, etc.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[isoDayOfWeek]
--------------------------------------------------
Expand All @@ -309,7 +309,7 @@ ISO_WEEK_OF_YEAR(date_exp) <1>
Extract the week of the year from a date, following https://en.wikipedia.org/wiki/ISO_week_date[ISO 8601 standard]. The first week
of a year is the first week with a majority (4 or more) of its days in January.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[isoWeekOfYear]
--------------------------------------------------
Expand All @@ -333,7 +333,7 @@ MINUTE_OF_DAY(date_exp) <1>

Extract the minute of the day from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[minuteOfDay]
--------------------------------------------------
Expand All @@ -357,7 +357,7 @@ MINUTE_OF_HOUR(date_exp) <1>

Extract the minute of the hour from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[minuteOfHour]
--------------------------------------------------
Expand All @@ -381,7 +381,7 @@ MONTH(date_exp) <1>

Extract the month of the year from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[monthOfYear]
--------------------------------------------------
Expand All @@ -405,7 +405,7 @@ MONTH_NAME(date_exp) <1>

Extract the month from a datetime in text format (`January`, `February`...).

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[monthName]
--------------------------------------------------
Expand All @@ -428,15 +428,15 @@ NOW()
This function offers the same functionality as <<sql-functions-current-timestamp,CURRENT_TIMESTAMP()>> function: returns the date/time
when the current query reached the server. This method always returns the same value within a query.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[nowFunction]
--------------------------------------------------

Typically, this function (as well as its twin <<sql-functions-current-timestamp,CURRENT_TIMESTAMP())>> function is used for
relative date/time filtering:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[filterNow]
--------------------------------------------------
Expand All @@ -460,7 +460,7 @@ SECOND_OF_MINUTE(date_exp) <1>

Extract the second of the minute from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[secondOfMinute]
--------------------------------------------------
Expand All @@ -484,7 +484,7 @@ QUARTER(date_exp) <1>

Extract the year quarter the date falls in.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[quarter]
--------------------------------------------------
Expand All @@ -508,7 +508,7 @@ WEEK_OF_YEAR(date_exp) <1>

Extract the week of the year from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[weekOfYear]
--------------------------------------------------
Expand All @@ -532,7 +532,7 @@ YEAR(date_exp) <1>

Extract the year from a date.

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[year]
--------------------------------------------------
Expand Down Expand Up @@ -560,14 +560,14 @@ EXTRACT(
Extract fields from a datetime by specifying the name of a <<sql-functions-datetime,datetime function>>.
The following

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[extractDayOfYear]
--------------------------------------------------

is the equivalent to

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[dayOfYear]
--------------------------------------------------
10 changes: 5 additions & 5 deletions docs/reference/sql/functions/grouping.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,29 @@ NOTE:: The histogram in SQL does *NOT* return empty buckets for missing interval
`Histogram` can be applied on either numeric fields:


["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[histogramNumeric]
----

or date/time fields:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[histogramDate]
----

Expressions inside the histogram are also supported as long as the
return type is numeric:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[histogramNumericExpression]
----

Do note that histograms (and grouping functions in general) allow custom expressions but cannot have any functions applied to them in the `GROUP BY`. In other words, the following statement is *NOT* allowed:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[expressionOnHistogramNotAllowed]
----
Expand All @@ -77,7 +77,7 @@ as it requires two groupings (one for histogram followed by a second for applyin

Instead one can rewrite the query to move the expression on the histogram _inside_ of it:

["source","sql",subs="attributes,callouts,macros"]
[source, sql]
----
include-tagged::{sql-specs}/docs.csv-spec[histogramDateExpression]
----
Loading

0 comments on commit 4c6944f

Please sign in to comment.