hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Weeks (JIRA)" <>
Subject [jira] [Commented] (HIVE-20012) Implement SQL Standard Date and Timestamp Functions
Date Sun, 21 Oct 2018 05:34:00 GMT


Shawn Weeks commented on HIVE-20012:

I've created an initial version of the to_timestamp UDF. Currently the project I'm working
on is still using Hive 1.2.1 so I've had to stick to older versions of some classes. If someone
as interested and has suggestions you can take a look at

> Implement SQL Standard Date and Timestamp Functions
> ---------------------------------------------------
>                 Key: HIVE-20012
>                 URL:
>             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

View raw message