I think you are looking for-

C = join FILTERED_A by key1, B by key1;
C1 = filter C by <some condition>;

if key1 equality is not your join condition, you may have to go for a CROSS.

Thanks,
Aniket

On Thu, Mar 1, 2012 at 4:26 AM, mete <efk...@gmail.com> wrote:

> Hello folks,
>
> i am new to pig-latin and i am trying to implement a use case as poc.
>
> I have 2 files that i should correlate, similar to this:
>
> A (date,key1,key2)
> B (startdate,enddate,key1,key3)
>
> so what i am trying to do is:
> query for key2
> for all the matches
> find key3 from B if the date range matches
>
> So this is what i have come up with so far:
>
> A = LOAD ...;
> B = LOAD ...;
>
> FILTERED_A = FILTER A BY key2="my_value";
> XX = FOREACH FILTERED_A {
>        RESULT= FILTER B BY (.... some conditions .....)
>        DUMP RESULT;
> };
>
> But this just gives me the error in subject without pointers to any
> line/char. I am using 0.8.1-cdh3u3.
> Any ideas?
>
>
> As a side question, i could not figure out howto provide multiple input
> files for pigunit for  a case like the above,
> Is anyone familiar with pigunit?
>
>
>
> Thanks in advance
> Mete
>



-- 
"...:::Aniket:::... Quetzalco@tl"

Reply via email to