Join 通过使用或条件运算符的Pig联接引发错误

Join 通过使用或条件运算符的Pig联接引发错误,join,apache-pig,Join,Apache Pig,使用OR条件时出现以下错误: 错误org.apache.pig.PigServer-解析期间异常:错误 在解析过程中。Pig脚本无法分析: NoViableAltException(91@[])未能分析:Pig脚本未能 解析:NoviableException(91@[] 以下语法不正确,Pig中没有条件联接 child = load 'file_name' using PigStorage('\t') as (child_code : chararray, child_id : int, ch

使用OR条件时出现以下错误:

错误org.apache.pig.PigServer-解析期间异常:错误 在解析过程中。Pig脚本无法分析: NoViableAltException(91@[])未能分析:Pig脚本未能 解析:NoviableException(91@[]


以下语法不正确,Pig中没有条件联接

child = load 'file_name' using PigStorage('\t') as (child_code : chararray, child_id : int, child_precode_id : int);
parents = load 'file_name' using PigStorage('\t') as (child_id : int, child_internal_id : chararray, mother_id : int, father_id : int);
joined = JOIN child by child_id, parents by child_id;
mainparent = FOREACH joined GENERATE child_id as child_id_source, child_precode_id, child_code;
store parent into '(location of file)' using PigStorage('\t');
childfirst = JOIN  mainparent by (child_id_source), parents by (mother_id OR father_id);
firstgen = FOREACH childfirst GENERATE child_id, child_precode_id, child_code;   
store firstgen into 'file_location' using PigStorage('\t');
如果要将一个键的关系与两个键上的另一个关系连接起来,请创建两个连接并合并数据集。请注意,可能需要区分结果关系

childfirst = JOIN  mainparent by (child_id_source), parents by (mother_id OR father_id);

这就行了,它还解决了获取副本的问题,谢谢
childfirst = JOIN  mainparent by (child_id_source), parents by (mother_id);
childfirst1 = JOIN  mainparent by (child_id_source), parents by (father_id);
childfirst2 = UNION childfirst,childfirst1;
childfirst3 = DISTINCT childfirst2;
firstgen = FOREACH childfirst3 GENERATE child_id, child_precode_id, child_code;   
store firstgen into 'file_location' using PigStorage('\t');