You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Vitalii Diravka (JIRA)" <ji...@apache.org> on 2017/06/20 07:41:01 UTC

[jira] [Commented] (DRILL-4721) Doc "dateDiff" in Drill

    [ https://issues.apache.org/jira/browse/DRILL-4721?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055286#comment-16055286 ] 

Vitalii Diravka commented on DRILL-4721:
----------------------------------------

[~bbevens] 
datediff() is [hive built-in function|https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF] and we can use it in Drill according to https://drill.apache.org/docs/why-drill/#8.-user-defined-functions-(udfs)-for-drill-and-hive

But Drill has date_diff() function, which can be documented. You can see my [comment|https://issues.apache.org/jira/browse/DRILL-4116?focusedCommentId=16055264&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16055264] with an example of using it.

> Doc "dateDiff" in Drill
> -----------------------
>
>                 Key: DRILL-4721
>                 URL: https://issues.apache.org/jira/browse/DRILL-4721
>             Project: Apache Drill
>          Issue Type: Task
>          Components: Documentation
>            Reporter: Bridget Bevens
>            Assignee: Bridget Bevens
>            Priority: Minor
>
> Fwd: [mapr-tech-qa:12242]Doc "dateDiff" in Drill
> Inbox
> x 
> Neeraja Rentachintala
> 3:32 PM (19 minutes ago)
> to me 
> we should document the datediff function. Cisco was asking about it today.
> ---------- Forwarded message ----------
> From: Bob Rumsby <br...@maprtech.com>
> Date: Thu, Aug 20, 2015 at 11:56 AM
> Subject: Re: [mapr-tech-qa:12242] "dateDiff" in Drill
> To: "mapr-tech-qa@maprtech.com" <ma...@maprtech.com>
> Yes, it should be. We can fix that.
> Bob
> On Thu, Aug 20, 2015 at 11:46 AM, Joseph Blue <jb...@maprtech.com> wrote:
> Seems as though functions like datediff should be here:
> https://drill.apache.org/docs/date-time-functions-and-arithmetic/
> On Thu, Aug 20, 2015 at 11:32 AM, Ted Dunning <td...@maprtech.com> wrote:
> Joe
> Do you have a suggestion for the docs?  Perhaps a few cross links would make it better?
> Sent from my iPhone
> On Aug 20, 2015, at 5:36, Joseph Blue <jb...@maprtech.com> wrote:
> OK, duh. Thanks for that. I just went down the wrong path in the documentation. 
> This obviously does exactly what I want.
> On Wed, Aug 19, 2015 at 10:26 PM, Mehant Baid <mb...@maprtech.com> wrote:
> You can use the datediff function as follows:
>  select datediff(date '2008-2-23', date '2008-1-20') from cp.`employee.json` limit 1;
> +---------+
> | EXPR$0  |
> +---------+
> | 34      |
> +---------+
> Thanks
> Mehant
> On Wed, Aug 19, 2015 at 7:00 PM, Joseph Blue <jb...@maprtech.com> wrote:
> Want to get the difference between two dates in Drill. I used the AGE function which produces an interval. But I want the answer in days, not months & days. Am I missing something from the documentation?
> select age(cast('2015-01-01' as timestamp),cast('2014-11-30' as timestamp)) from sys.version;
> +---------+
> | EXPR$0  |
> +---------+
> | P1M2D   |
> +---------+
> -- 
> Joseph Blue
> Data Scientist



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)