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

ASF GitHub Bot commented on DRILL-549:
--------------------------------------

GitHub user mehant opened a pull request:

    https://github.com/apache/incubator-drill/pull/52

    DRILL-549: Implement functions for date and interval data types

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/mehant/incubator-drill date_functions

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-drill/pull/52.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #52
    
----
commit b5424486dfa101b3481474b073292e492468533a
Author: Mehant Baid <[email protected]>
Date:   2014-04-18T02:02:25Z

    DRILL-549: Implement functions for date and interval data types
    
    Jira, DRILL-549 has the complete list of functions implemented.

----


> Implement functions for date and interval data types
> ----------------------------------------------------
>
>                 Key: DRILL-549
>                 URL: https://issues.apache.org/jira/browse/DRILL-549
>             Project: Apache Drill
>          Issue Type: New Feature
>            Reporter: Mehant Baid
>            Assignee: Mehant Baid
>
> Below is the list of functions to be supported as part of this task:
> Date & Interval Arithmetic Functions:
> date +/- integer
> date + interval 
> time + interval 
> timestamp + interval 
> timestamptz + interval
> date + intervalday 
> time + intervalday 
> timestamp + intervalday
> timestamptz + intervalday
> date + intervalyear 
> time + intervalyear
> timestamp + intervalyear 
> timestamptz + intervalyear
> date + time
> date - date
> time - time
> timestamp - timestamp
> timestamptz - timestamptz
> interval +/- interval
> intervalday +/- intervalday
> intervalyear +/- intervalyear
> interval *//(div) integer or float or double
> intervalday *//(div) integer or float or double
> intervalyear *//(div) integer or float or double
> -interval
> -intervalday
> -intervalyear
> Date Utility Functions:
> CURRENT_DATE
> CURRENT_TIME
> CURRENT_TIMESTAMP
> LOCALTIME
> LOCALTIMESTAMP
> now()
> timeofday()
> clock_timestamp()
> // For each of the below functions, the 'text' parameter can be one of the 
> following {year, month, day, hour, minute, second}
> date_part(text, date)
> date_part(text, time)
> date_part(text, timestamp)
> date_part(text, timestamptz)
> date_part(text, interval)
> date_part(text, intervalday)
> date_part(text, intervalyear)
> // Extract functions similar to date_part
> extract(field from date)
> extract(field from time)
> extract(field from timestamp)
> extract(field from timestamptz)
> extract(field from interval)
> extract(field from intervalday)
> extract(field from intervalyear) 
> Date Formatting Functions: 
> // 'text' parameter represents the desired output format
> to_char(date, text)
> to_char(time, text)
> to_char(timestamp, text)
> to_char(timestamptz, text)
> // In the below functions first 'text' param represents the string to be 
> converted to date type
> // Second 'text' param represents the format its in
> to_date(text, text) 
> to_time(text, text) 
> to_timestamp(text, text) 
> to_timestamptz(text, text) 
> // Input is long milliseconds from epoch
> to_date(long)
> to_time(long)
> to_timestamp(long)
> to_timestamptz(long)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to