drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinfengni <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4551: Implement new functions (cot, rege...
Date Tue, 29 Mar 2016 23:38:22 GMT
Github user jinfengni commented on a diff in the pull request:

    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/DateTypeFunctions.java
    @@ -40,6 +41,36 @@
     public class DateTypeFunctions {
    +    /**
    +     * 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.
    +     */
    +    @SuppressWarnings("unused")
    +    @FunctionTemplate(name = "isdate", scope = FunctionTemplate.FunctionScope.SIMPLE,
    --- End diff --
    Have you checked isdate() returns null for null input in other system like oracle? I thought
it would return either true or false. 

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message