我需要使用固定宽度文件
的猪脚本识别新记录(更新和插入)以下是2个虚拟文件 -
姓名(31)地址(39)联系人(14)月(10)开始日期(16)价值日期(16)NOM(7)总计(15) tatavisocáncyssérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000 logicásérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000 sonsérvices119street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 las 95000 创意咨询服务113 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 cs 0095000 Lake dew consultancy113pérk街道globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 ldS 00095000
Creativesérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 CS 95000 hindustan computer 113 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000
acia computer 113 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 095000
姓名(31)地址(39)联系人(14)月(10)开始日期(16)价值日期(16)NOM(7)总计(15) tatavisocáncyssérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000 logicásérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000 sonsérvices119street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 las 95000 创意咨询服务113 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 cs 0095000 Lake dew consultancy113pérk街道globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 ldS 00095000
Creativesérvices113street street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 CS 95000 hindustan computer 113 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 TCS 95000
acia computer 103 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 ACS 098000 CREST计算机123公园街道globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 CRS 0900
acia computer 103 park street globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 ACS 098000 CREST计算机123公园街道globalview kolkota 16 9030303030 7月20-10-15 25-12-2015 CRS 0900
感谢您的帮助
答案 0 :(得分:0)
file1 = LOAD 'file1path' USING PigStorage() AS line:chararray;
file2 = LOAD 'file2path' USING PigStorage() AS line:chararray;
rightOuter = JOIN file1 RIGHT OUTER file2;
file2Only = FILTER rightOuter BY file1::line IS NULL;
file2Only = FOREACH file2Only GENERATE file2::line AS line;
DUMP file2Only;