From d297f9342d40447e8906c3dbfb35afba5a406d14 Mon Sep 17 00:00:00 2001 From: Marios Trivyzas Date: Fri, 29 Mar 2019 19:58:59 +0100 Subject: [PATCH] SQL: [Docs] Fix doc errors regarding CURRENT_DATE. Some parts wrongly refered to CURRENT_TIMESTAMP. --- .../reference/sql/functions/date-time.asciidoc | 8 +++++++- .../qa/src/main/resources/docs/docs.csv-spec | 18 ++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/reference/sql/functions/date-time.asciidoc b/docs/reference/sql/functions/date-time.asciidoc index d4beaa34bd774..f3060d81b3ffc 100644 --- a/docs/reference/sql/functions/date-time.asciidoc +++ b/docs/reference/sql/functions/date-time.asciidoc @@ -99,6 +99,7 @@ Functions that target date/time. -------------------------------------------------- CURRENT_DATE CURRENT_DATE() +CURDATE() -------------------------------------------------- *Input*: _none_ @@ -117,7 +118,12 @@ This method always returns the same value for its every occurrence within the sa ["source","sql",subs="attributes,callouts,macros"] -------------------------------------------------- -include-tagged::{sql-specs}/docs/docs.csv-spec[curDate] +include-tagged::{sql-specs}/docs/docs.csv-spec[currentDate] +-------------------------------------------------- + +["source","sql",subs="attributes,callouts,macros"] +-------------------------------------------------- +include-tagged::{sql-specs}/docs/docs.csv-spec[currentDateFunction] -------------------------------------------------- ["source","sql",subs="attributes,callouts,macros"] diff --git a/x-pack/plugin/sql/qa/src/main/resources/docs/docs.csv-spec b/x-pack/plugin/sql/qa/src/main/resources/docs/docs.csv-spec index 820c358ab2f62..9e8bad1c88f11 100644 --- a/x-pack/plugin/sql/qa/src/main/resources/docs/docs.csv-spec +++ b/x-pack/plugin/sql/qa/src/main/resources/docs/docs.csv-spec @@ -2359,18 +2359,28 @@ SELECT WEEK(CAST('1988-01-05T09:22:10Z' AS TIMESTAMP)) AS week, ISOWEEK(CAST('19 currentDate-Ignore -// tag::curDate -SELECT CURRENT_TIMESTAMP AS result; +// tag::currentDate +SELECT CURRENT_DATE AS result; result ------------------------ 2018-12-12 -// end::curDate +// end::currentDate ; currentDateFunction-Ignore +// tag::currentDateFunction +SELECT CURRENT_DATE() AS result; + + result +------------------------ +2018-12-12 +// end::currentDateFunction +; + +curDateFunction-Ignore // tag::curDateFunction -SELECT CURRENT_TIMESTAMP() AS result; +SELECT CURRENT_DATE() AS result; result ------------------------