Making JobConf accessible to UDFs is part of the plan behind HIVE-1016 (Distributed Cache access for UDFs). I'll file a JIRA for a rowid() UDF and link it to this.
Carl On Thu, Feb 25, 2010 at 9:00 PM, Zheng Shao <[email protected]> wrote: > Not right now. It should be pretty simple to do though. We can expose > the current JobConf via a static method in ExecMapper. > > Zheng > > On Thu, Feb 25, 2010 at 7:52 AM, Todd Lipcon <[email protected]> wrote: > > Zheng: is there a way to get at the hadoop conf variables from within a > > query? If so, you could use mapred.task.id to get a unique string. > > -Todd > > > > On Thu, Feb 25, 2010 at 12:42 AM, Zheng Shao <[email protected]> wrote: > >> > >> Since Hive runs many mappers/reducers in parallel, there is no way to > >> generate a globally unique increasing row id. > >> If you are OK with that, you can easily write a "non-deterministic" > >> UDF. See rand() (or UDFRand.java) for example. > >> > >> Please open a JIRA if you plan to work on that. > >> > >> Zheng > >> > >> On Wed, Feb 24, 2010 at 6:47 PM, Weiwei Hsieh <[email protected]> > >> wrote: > >> > All, > >> > > >> > > >> > > >> > Could anyone tell me on how to generate a row id for a new record in > >> > Hive? > >> > > >> > > >> > > >> > Many thanks. > >> > > >> > > >> > > >> > weiwei > >> > >> > >> > >> -- > >> Yours, > >> Zheng > > > > > > > > -- > Yours, > Zheng >
