A = load 'a.txt' as (id, a1);
B = load 'b.txt as (id, b1);
C = join A by id, B by id;
D = foreach C generate id,a1,b1;
dump D;
4th line fails on:
Invalid field projection. Projected field [id] does not exist in schema
I tried to change to A.id but then the last line fails on: ERROR 0: Scalar has more than one row in the output.
@nweiler :if you know the first and last field of relation A then you can write something like below:
This will give you all the columns between FirstCol and LastCol.
What you are looking for is the "Disambiguate Operator". What you want is
A::id
, notA.id
.A.id
says "there is a relation/bagA
and there is a column calledid
in its schema"A::id
says "there is a record fromA
and that has a column calledid
"So, you would do:
A dirty alternative:
Just because I'm lazy, and disambiguation gets really weird when you start doing multiple joins one after another: use unique identifiers.