1
嗨,我有一個這樣的豬腳本。在做foreach語句時,它會拋出無效的標量投影錯誤。這裏是我的代碼。foreach中的標量投影無效
a = load 'file' using PigStorage(':');
b = group a by ($1, $7, $11);
c = foreach b generate flatten(group), COUNT(a) as (cnt: int);
d = filter c by cnt>1;
e = foreach d generate flatten(a) ;
如下所示
<line 6, column 31> Invalid scalar projection: a : A column needs to be projected from a relation for it to be used as a scalar
該錯誤的任何幫助將不勝感激。
我昨天張貼了這個代碼作爲一個答案。如果你在'$ 1,$ 7,$ 11'分組後沒有得到任何重複的行,你的關係'd'將是空的,因此當你試圖實現關係'e'時,你會得到這個錯誤。 – philantrovert
謝謝philan ... – Rakshita