Skip to content

Commit

Permalink
SQL: Spec tests now use classpath discovery (#40388)
Browse files Browse the repository at this point in the history
To avoid having to specify each spec by hand (which can miss specs to be
added), the test infrastructure now performs classpath discovery so that
each spec added, is automatically considered.

Relates #40358
  • Loading branch information
costin authored Mar 25, 2019
1 parent 5bbdc80 commit d0f60b4
Show file tree
Hide file tree
Showing 28 changed files with 336 additions and 231 deletions.
50 changes: 25 additions & 25 deletions docs/reference/sql/functions/aggs.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Returns the https://en.wikipedia.org/wiki/Arithmetic_mean[Average] (arithmetic m

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

[[sql-functions-aggs-count]]
Expand Down Expand Up @@ -58,7 +58,7 @@ In case of `COUNT(<field_name>)` `null` values are not considered.

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


Expand All @@ -83,7 +83,7 @@ Returns the total number (count) of all _non-null_ input values. `COUNT(<field_n

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


Expand All @@ -108,7 +108,7 @@ Returns the total number of _distinct non-null_ values in input values.

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

[[sql-functions-aggs-first]]
Expand Down Expand Up @@ -175,29 +175,29 @@ s| FIRST(a, b)

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

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

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

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

`FIRST_VALUE` is a name alias and can be used instead of `FIRST`, e.g.:

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

[NOTE]
Expand Down Expand Up @@ -270,29 +270,29 @@ s| LAST(a, b)

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

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

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

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

`LAST_VALUE` is a name alias and can be used instead of `LAST`, e.g.:

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

[NOTE]
Expand Down Expand Up @@ -322,7 +322,7 @@ Returns the maximum value across input values in the field `field_name`.

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

[NOTE]
Expand Down Expand Up @@ -350,7 +350,7 @@ Returns the minimum value across input values in the field `field_name`.

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

[NOTE]
Expand Down Expand Up @@ -378,7 +378,7 @@ Returns the sum of input values in the field `field_name`.

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

==== Statistics
Expand All @@ -404,7 +404,7 @@ https://en.wikipedia.org/wiki/Kurtosis[Quantify] the shape of the distribution o

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

[[sql-functions-aggs-mad]]
Expand All @@ -428,7 +428,7 @@ https://en.wikipedia.org/wiki/Median_absolute_deviation[Measure] the variability

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

[[sql-functions-aggs-percentile]]
Expand All @@ -454,7 +454,7 @@ of input values in the field `field_name`.

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

[[sql-functions-aggs-percentile-rank]]
Expand All @@ -480,7 +480,7 @@ of input values in the field `field_name`.

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

[[sql-functions-aggs-skewness]]
Expand All @@ -504,7 +504,7 @@ https://en.wikipedia.org/wiki/Skewness[Quantify] the asymmetric distribution of

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

[[sql-functions-aggs-stddev-pop]]
Expand All @@ -528,7 +528,7 @@ Returns the https://en.wikipedia.org/wiki/Standard_deviations[population standar

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

[[sql-functions-aggs-sum-squares]]
Expand All @@ -552,7 +552,7 @@ Returns the https://en.wikipedia.org/wiki/Total_sum_of_squares[sum of squares] o

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

[[sql-functions-aggs-var-pop]]
Expand All @@ -576,5 +576,5 @@ Returns the https://en.wikipedia.org/wiki/Variance[population variance] of input

["source","sql",subs="attributes,macros"]
--------------------------------------------------
include-tagged::{sql-specs}/docs.csv-spec[aggVarPop]
include-tagged::{sql-specs}/docs/docs.csv-spec[aggVarPop]
--------------------------------------------------
28 changes: 14 additions & 14 deletions docs/reference/sql/functions/conditional.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ If all arguments are null, then it returns `null`.

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

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


Expand Down Expand Up @@ -74,12 +74,12 @@ If all arguments are null, then it returns `null`.

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

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


Expand Down Expand Up @@ -111,12 +111,12 @@ If all arguments are null, then it returns `null`.

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

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


Expand Down Expand Up @@ -148,12 +148,12 @@ If all arguments are null, then it returns `null`.

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

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


Expand Down Expand Up @@ -183,12 +183,12 @@ if not, it returns the 1st expression.

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

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


Expand Down Expand Up @@ -225,12 +225,12 @@ If all arguments are null, then it returns `null`.

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

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


Expand Down Expand Up @@ -267,10 +267,10 @@ If all arguments are null, then it returns `null`.

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

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

0 comments on commit d0f60b4

Please sign in to comment.