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

Shawn Weeks commented on HIVE-20012:
------------------------------------

[~bharos92] Sorry for the delay. If we make it behave like Oracle than it will 
either accept two strings, or some type that is cast-able to a timestamp or 
date. For example in Oracle to_timestamp will accept a date as a single 
parameter and cast it to a timestamp. All of my use cases though are for 
explicit converting a string to timestamp or date.

> Implement SQL Standard Date and Timestamp Functions
> ---------------------------------------------------
>
>                 Key: HIVE-20012
>                 URL: https://issues.apache.org/jira/browse/HIVE-20012
>             Project: Hive
>          Issue Type: New Feature
>            Reporter: Shawn Weeks
>            Priority: Minor
>
> I've looked around and haven't seen an existing ticket on this. Many times 
> you need to convert from arbitrary string formats to a date or a timestamp. 
> The current method using the unix_timestamp function doesn't support 
> milliseconds and is a bit clunky. I propose we implement a to_date and 
> to_timestamp function that behave like the following. It may also be useful 
> for the to_timestamp function to behave like the existing to_date function 
> and convert Hive's default timestamp string into an actual timestamp.
> {code:java}
> select to_date('01-01-2000','dd-MM-yyyy');
> 2000-01-01
> select to_timestamp('01-01-2000 13:00:00.000','dd-MM-yyyy HH:mm:ss.SSS')
> 2000-01-01 13:00:00.000{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to