current date

18 views
Skip to first unread message

Laurie Elven

unread,
Jun 21, 2016, 5:37:14 PM6/21/16
to qubole...@googlegroups.com
how to write current date in a query

Xing Quan

unread,
Jun 21, 2016, 10:54:13 PM6/21/16
to qubole...@googlegroups.com, laurie...@oracle.com
Hi Laurie,

For Hive, we have a cheat sheet of built-in functions: https://www.qubole.com/resources/cheatsheet/hive-function-cheat-sheet/

To get the current date, I usually make use of the unix_timestamp() function, which returns the current time stamp in unix time. You can then convert that to a date format via the from_unixtime function. 

So, as an example, you could have something like this in your where statements to filter to the current date:

where date = from_unixtime(unix_timestamp())

Let me know if that helps - thanks.

Xing


Xing Quan


On Tue, Jun 21, 2016 at 2:37 PM, Laurie Elven <laurie...@oracle.com> wrote:
how to write current date in a query

--
You received this message because you are subscribed to the Google Groups "Qubole Public Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qubole-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qubole-users/5769b38338e9b_250e2ab0fbbc3528349e%40ip-10-149-158-16.mail.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages