Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3820D191A8 for ; Wed, 30 Mar 2016 18:50:55 +0000 (UTC) Received: (qmail 37579 invoked by uid 500); 30 Mar 2016 18:50:55 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 37533 invoked by uid 500); 30 Mar 2016 18:50:55 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 37520 invoked by uid 99); 30 Mar 2016 18:50:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Mar 2016 18:50:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 902ADDFC6E; Wed, 30 Mar 2016 18:50:54 +0000 (UTC) From: jaltekruse To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request: DRILL-4551: Implement new functions (cot, rege... Content-Type: text/plain Message-Id: <20160330185054.902ADDFC6E@git1-us-west.apache.org> Date: Wed, 30 Mar 2016 18:50:54 +0000 (UTC) Github user jaltekruse commented on a diff in the pull request: https://github.com/apache/drill/pull/452#discussion_r57942687 --- 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, nulls=NullHandling.NULL_IF_NULL, --- End diff -- I couldn't find a definite answer on that in the oracle docs, and I didn't have an oracle install to verify on. This Sql Server page is clear that they do return 0 on null and I assume oracle is the same, will update the patch. https://msdn.microsoft.com/en-us/library/ms187347.aspx --- 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. ---