1
我想加入兩個別名/關係,加入Apache的豬兩個別名基於一個條件
say A has keys : a,b,c
and B has keys : x,y,z
所以它應該是:
C = JOIN A by a, (IF B.x matches "foo.*" then pick y else z)
如上logic.How能我這樣做?
我想加入兩個別名/關係,加入Apache的豬兩個別名基於一個條件
say A has keys : a,b,c
and B has keys : x,y,z
所以它應該是:
C = JOIN A by a, (IF B.x matches "foo.*" then pick y else z)
如上logic.How能我這樣做?
我的回答:
只是基於條件的鍵,然後按該鍵
如加入。
BB = foreach B generate x,y,z,(x matches "foo.*") ? y : z as matchkey;
C = join A by a, BB by matchkey;
dump c;