- All Implemented Interfaces:
- DrillFunc, DrillSimpleFunc
- Enclosing class:
- DateTypeFunctions
public static class DateTypeFunctions.IsDate
extends Object
implements DrillSimpleFunc
Function to check if a varchar value can be cast to a date.
At the time of writing this function, several other databases were checked
for behavior compatibility. There was not a consensus between oracle and
Sql server about the expected behavior of this function, and Postgres
lacks it completely.
Sql Server appears to have both a DATEFORMAT and language locale setting
that can change the values accepted by this function. Oracle appears to
support several formats, some of which are not mentioned in the Sql
Server docs. With the lack of standardization, we decided to implement
this function so that it would only consider date strings that would be
accepted by the cast function as valid.