We had written similar UDF to leverage simple date math via conversion to Unix timestamp but didn't devise any mechanism to overcome the drift when doing 'now()-to_unixtime(a.ts)' since now() is continually revaluated over the lifetime of the MR job per record -- is there any way to force single, pre-MR parse-time evaluation of now() to literal? In many cases the drift can be ignored (e.g. age) and obvious workaround is to dynamically generate the query with static timestamp as opposed to now().
On Jul 13, 2009 1:49 AM, "Zheng Shao" <[email protected]> wrote: Hi Saurabh, Hive does not have a native date/time data type. In all the cases that we have seen, storing timestamp as BIGINT or STRING is good enough for our users' applications. There is a set of UDFs for date/time stored as bigint/string: http://wiki.apache.org/hadoop/Hive/LanguageManual/UDF#head-8c92c62e9912ded44cc753d56fdf973ca1377f37 It's also very easy to write your own UDFs. Zheng On Mon, Jul 13, 2009 at 1:32 AM, Saurabh Nanda<[email protected]> wrote: > Hi, > > I'm a compl... -- Yours, Zheng
