How do I display the date only once using the inbuilt Date and Time functions
In mysql we can do select curdate();
to get
+------------+
| curdate() |
+------------+
| 2013-07-23 |
+------------+
Trying select unixtime();
in Hive gives me FAILED: ParseException line 1:17 mismatched input '<EOF>' expecting FROM near ')' in from clause
Doing , select from_unixtime(unix_timestamp(),"yyyy-MM-hh") from abc.xyz LIMIT 1;
gives me
OK
2013-07-03
my expected output but it doesn't seem really sensible to me to use a random database and its table just for accessing the date
. What is the proper way of doing this?
Currently, Hive does not support constructing rows without reading any other tables (which is what you are trying to do when you run select curdate()
or select curdate() from dual
).
This is work in progress.
How do I display the date only once using the inbuilt Date and Time functions
In mysql we can do select curdate();
to get
+------------+
| curdate() |
+------------+
| 2013-07-23 |
+------------+
Trying select unixtime();
in Hive gives me FAILED: ParseException line 1:17 mismatched input '<EOF>' expecting FROM near ')' in from clause
Doing , select from_unixtime(unix_timestamp(),"yyyy-MM-hh") from abc.xyz LIMIT 1;
gives me
OK
2013-07-03
my expected output but it doesn't seem really sensible to me to use a random database and its table just for accessing the date
. What is the proper way of doing this?
Currently, Hive does not support constructing rows without reading any other tables (which is what you are trying to do when you run select curdate()
or select curdate() from dual
).
This is work in progress.
0 commentaires:
Enregistrer un commentaire