0

Iam new to Pig scripts. I need help in joining 'B' and 'E'. Below is my script.

    A = LOAD ....
    PAPS_1 = FILTER A BY (dataMap#'corr_id_' is NOT null);
    B = FOREACH PAPS_1 GENERATE dataMap#'corr_id_' as id, dataMap#'response' as resp, status;
    C = LOAD ..
    D = FILTER C BY (dataMap#'corr_id_' is NOT null);
    E = FOREACH D GENERATE dataMap#'corr_id_' as id, status;

I tried joining like this. But it doesn't work. I am getting null values. Please correct me.

F = JOIN B BY id, E BY id;

Values in B:

23456ac, 200, 0

3453da3, 200, 0

Values in C:

23456ac, 0

3453da3, 0

Values in E:

23456ac, 0

3453da3, 0

My output is:

NULL, 200, 0, NULL, 0

NULL, 200, 0, NULL, 0

Expected is:

23456ac, 200, 0, 23456ac, 0

3453da3, 200, 0, 3453da3, 0

Thanks In Advance

Anjanaa
  • 31
  • 1
  • 7

0 Answers0