Correlated Subqueries Workaround in Hive!

2014-09-15 Thread Viral Parikh
To Whomsoever It May Concern, I posted this question last week but still haven't heard from anyone; I'd appreciate any reply. I've got a table that contains a LocationId field. In some cases, where a record shares the same foreign key, the LocationId might come through as -1. What I want to do

Re: Correlated Subqueries Workaround in Hive!

2014-09-15 Thread Nitin Pawar
have you taken a look at lag and lead functions ? On Mon, Sep 15, 2014 at 4:46 PM, Viral Parikh viral.j.par...@gmail.com wrote: To Whomsoever It May Concern, I posted this question last week but still haven't heard from anyone; I'd appreciate any reply. I've got a table that contains a

Re: Correlated Subqueries Workaround in Hive!

2014-09-15 Thread Sreenath
How about writing a python UDF that takes input line by line and it saves the previous lines location and can replace it with that if location turns out to be '-1' On 15 September 2014 17:01, Nitin Pawar nitinpawar...@gmail.com wrote: have you taken a look at lag and lead functions ? On Mon,

Re: Correlated Subqueries Workaround in Hive!

2014-09-15 Thread Nitin Pawar
Other way I can think at this is .. 1) ignore all -1 and create a tmp table 2) I see there are couple of time stamps 3) Oder the table by timestamp 4) from this tmp tabel create anothe tmp table which says FK MinStartTime MaxEndTime Location 5) Now this tmp table from step 4 join with ur raw data