我正在加入 3 个表,在 foreach 中我需要检查 ReadStagingData 包是否为空。 下面是代码
ReadStagingData = Load 'Staging_data.csv' Using PigStorage(',') As (PL_Posn_id:int,Brok_org_dly:double,Brok_org_ptd:double);
ReadPriorData = Load 'ptd.csv' Using PigStorage(',') As (PL_Posn_id:int,Brok_org_ptd:double);
ReadPriorFunctional = Load 'Functional.csv' Using PigStorage(',') AS (PL_Posn_id:int,Brok_fun_ptd:double,Brok_fun_ltd:double);
JoinDS1 = JOIN ReadPriorData BY PL_Posn_id,ReadPriorFunctional BY PL_Posn_id;
JoinDS2 = JOIN ReadStagingData by PL_Posn_id Left OUTER,JoinDS1 BY ReadPriorData::PL_Posn_id;
X = Foreach JoinDS2 {
**test = (NOT(IsEmpty(ReadStagingData))); //Error on this line**
GENERATE test,ReadStagingData::PL_Posn_id,
ReadStagingData::Brok_org_dly,
(ReadStagingData::Brok_org_ptd is not null ? ReadStagingData::Brok_org_ptd:ReadPriorData::Brok_org_ptd+ReadStagingData::Brok_org_dly);
};
Dump X;
当我运行上面的代码时,我收到错误 INVALID PROJECTION ReadStagingData. Please help me