Hi Keith, We generally store date columns as a string in a similar format to ISO 8601 (yyyy-mm-dd hh:MM:ss). This way, when we put the date column in the ORDER BY clause, it will be sorted chronologically. It also saves us the trouble of whipping out a unix timestamp calculator to figure out what we're looking at.
There is supposed to be a TIMESTAMP data type in Hive 0.8, but I haven't found any documentation on it yet. Matt Tucker -----Original Message----- From: Keith Wiley [mailto:kwi...@keithwiley.com] Sent: Tuesday, March 13, 2012 12:45 PM To: user@hive.apache.org Subject: order by date I realize that hive doesn't have a date type for the columns and I realize that hive *does* have various date functions. I just haven't found a concrete example of how these two issues are brought together. Ordering the results of a sql query is done by adding "order by dateColName" to the query. Are the date functions supposed to be used in the form "order by UNIX_TIMESTAMP(dateColName, 'yyyy-MM-dd')"? Does the function just go right into the "order by" clause like that or is that totally wrong? How does one order query results by a date column? Am I on the right track? Thanks. ________________________________________________________________________________ Keith Wiley kwi...@keithwiley.com keithwiley.com music.keithwiley.com "What I primarily learned in grad school is how much I *don't* know. Consequently, I left grad school with a higher ignorance to knowledge ratio than when I entered." -- Keith Wiley ________________________________________________________________________________