This is an automated email from the ASF dual-hosted git repository. dzamo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill-site.git
The following commit(s) were added to refs/heads/master by this push: new 47ebf538d Document the isdate function. 47ebf538d is described below commit 47ebf538d63301de4df21425bc2998edf9d2feae Author: James Turton <ja...@somecomputer.xyz> AuthorDate: Fri Sep 2 07:57:57 2022 +0200 Document the isdate function. --- .../030-date-time-functions-and-arithmetic.md | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/_docs/en/sql-reference/sql-functions/030-date-time-functions-and-arithmetic.md b/_docs/en/sql-reference/sql-functions/030-date-time-functions-and-arithmetic.md index 856f5350f..cb785f49a 100644 --- a/_docs/en/sql-reference/sql-functions/030-date-time-functions-and-arithmetic.md +++ b/_docs/en/sql-reference/sql-functions/030-date-time-functions-and-arithmetic.md @@ -19,6 +19,7 @@ This section covers the Drill [time zone limitation]({{site.baseurl}}/docs/data- | [DATE_DIFF]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#date_diff) | DATE, TIMESTAMP | | [DATE_PART]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#date_part) | DOUBLE | | [DATE_SUB]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#date_sub) | DATE, TIMESTAMP | +| [ISDATE]({{site.baseurl}}/docs/date-time-functions-and-arithmetic/#isdate) | BOOLEAN | | [LOCALTIME]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#other-date-and-time-functions) | TIME | | [LOCALTIMESTAMP]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#other-date-and-time-functions) | TIMESTAMP | | [NOW]({{ site.baseurl }}/docs/date-time-functions-and-arithmetic/#other-date-and-time-functions) | TIMESTAMP | @@ -455,6 +456,34 @@ The `employee.json` file, which Drill includes in the installation, lists the hi |------------------------| 2 rows selected (0.161 seconds) +## ISDATE +Tests whether a character string represents a valid date. The test applied is equivalent +to asking whether an attempt to cast the string to date would succeed or fail. + +### ISDATE Syntax + +`isdate(date_string)` + +*date_string* is a character string possibly representing a valid date. + +### ISDATE Examples + + SELECT ISDATE('1970-01-01'); + |------------| + | EXPR$0 | + |------------| + | true | + |------------| + 1 row selected (0.098 seconds) + + SELECT ISDATE('foobar'); + |------------| + | EXPR$0 | + |------------| + | false | + |------------| + 1 row selected (0.088 seconds) + ## Other Date and Time Functions The following examples show how to use these functions: