As the post How to select current date in Hive SQL, to get the current date in Hive, unix_timestamp
can be used.
But I tried
select unix_timestamp();
and just,
unix_timestamp();
both give the error messages
FAILED: ParseException line 1:23 mismatched input '<EOF>' expecting FROM near ')' in from clause
FAILED: ParseException line 1:0 cannot recognize input near 'unix_timestamp' '(' ')'
respectively.
How can I use unix_timestamp
properly in Hive?
UPDATED!
https://issues.apache.org/jira/browse/HIVE-178 has resolved this issue.
If you use 0.13 (released on 21 April 2014) or above, you can
-- unix_timestamp() is deprecated
select current_timestamp();
select 1+1;
without from <table>
.