How to select current date in Hive SQL

Elingela picture Elingela · Jul 28, 2013 · Viewed 218.9k times · Source

How do we get the current system date in Hive? In MySQL we have select now(), can any one please help me to get the query results. I am very new to Hive, is there a proper documentation for Hive that gives the details information about the pseudo columns, and built-in functions.

Answer

Lukas Vermeer picture Lukas Vermeer · Jul 29, 2013

According to the LanguageManual, you can use unix_timestamp() to get the "current time stamp using the default time zone." If you need to convert that to something more human-readable, you can use from_unixtime(unix_timestamp()).

Hope that helps.