Join Pig脚本,用于连接一个表中的两列和另一个表中的一列

Join Pig脚本,用于连接一个表中的两列和另一个表中的一列,join,apache-pig,Join,Apache Pig,基本上,我正在尝试运行OR(如SQL查询中),其中employee\u internal\u id=mother\u id或father\u id。试试这个 empdoc = load 'file_name' using PigStorage('\t') as (emp_id : chararray, emp_code : chararray, employee_internal_id : int); masterdoc = load 'file_name' using PigStorage(

基本上,我正在尝试运行OR(如SQL查询中),其中employee\u internal\u id=mother\u id或father\u id。

试试这个

empdoc = load 'file_name' using PigStorage('\t') as (emp_id : chararray, emp_code : chararray, employee_internal_id : int);

masterdoc = load 'file_name' using PigStorage('\t')as (emp_internal_id : int, emp_id : chararray, mother_id : int, father_id : int, section_code : chararray);

childone = JOIN empdoc by (employee_internal_id), masterdoc by (mother_id) OR masterdoc by(father_id);

genone = FOREACH childone GENERATE employee_internal_id, emp_internal_id,emp_id, ;
试试这个

empdoc = load 'file_name' using PigStorage('\t') as (emp_id : chararray, emp_code : chararray, employee_internal_id : int);

masterdoc = load 'file_name' using PigStorage('\t')as (emp_internal_id : int, emp_id : chararray, mother_id : int, father_id : int, section_code : chararray);

childone = JOIN empdoc by (employee_internal_id), masterdoc by (mother_id) OR masterdoc by(father_id);

genone = FOREACH childone GENERATE employee_internal_id, emp_internal_id,emp_id, ;

失败,错误为1000:解析期间出错。第12行第0列出现词法错误。遇到:之后:“”脚本现在工作,但我得到的记录比预期的多。我试着从父级到子级运行一个树形结构5代失败,错误为1000:解析过程中出错。第12行第0列出现词法错误。遇到:之后:“”脚本现在工作,但我得到的记录比预期的多。我试着从父母那里穿过一座树的建筑,然后下到孩子们那里5代