Alan Gates
Wed, 03 Feb 2010 09:28:57 -0800
B = filter A by t1.a == t2.a and t1.b == t2.b; Alan. On Feb 3, 2010, at 1:23 AM, Neil Blue wrote:
Hello,From the documentation I understand that it should be possible to filter arelation based on the equality of tuples.http://hadoop.apache.org/pig/docs/r0.5.0/ piglatin_reference.html#deref:...Note 1: boolean (Tuple A is equal to tuple B if they have the same size s,and for all 0 <= i < s A[i] = = B[i]) ... However with this data file -- indext.txt: (1,one) (1,ONE) (2,two) (22, twentytwo) (3,three) (3,three) I run this pig script:A = LOAD 'indext.txt' AS (t1:(a:int, b:chararray), t2:(a:int, b:chararray));B = FILTER A BY t1==t2; DUMP B; Expecting the output: ((3,three),(3,three)) However there is an error:2010-02-03 09:05:20,523 [main] ERROR org.apache.pig.tools.grunt.Grunt -ERROR 2067: EqualToExpr does not know how to handle type: tuple Pig Stack Trace --------------- ERROR 2067: EqualToExpr does not know how to handle type: tupleorg.apache.pig.impl.logicalLayer.FrontendException: ERROR 1066: Unable toopen iterator for alias B at org.apache.pig.PigServer.openIterator(PigServer.java:475) atorg.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java: 532)atorg .apache .pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:190) atorg .apache .pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:166) atorg .apache .pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:142) at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:89) at org.apache.pig.Main.main(Main.java:397)Caused by: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1002:Unable to store alias B at org.apache.pig.PigServer.store(PigServer.java:530) at org.apache.pig.PigServer.openIterator(PigServer.java:458) ... 6 moreCaused by: org.apache.pig.backend.executionengine.ExecException: ERROR 2067:EqualToExpr does not know how to handle type: tuple atorg .apache .pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.EqualToExpr.getNext(EqualToExpr.java:108) atorg .apache .pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POFilter.getNext(POFilter.java:148) atorg .apache .pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:231) atorg .apache .pig.backend.local.executionengine.physicalLayer.counters.POCounter.getNext(POCounter.java:71) atorg .apache .pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:231) atorg .apache .pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getNext(POStore.java:117) atorg .apache .pig.backend.local.executionengine.LocalPigLauncher.runPipeline(LocalPigLauncher.java:146) atorg .apache .pig.backend.local.executionengine.LocalPigLauncher.launchPig(LocalPigLauncher.java:109) atorg .apache .pig.backend.local.executionengine.LocalExecutionEngine.execute(LocalExecutionEngine.java:165) .... I am using pig 0.5 and hadoop .20.1. Have I misunderstood the feature or is this a bug? Thanks Neil *********************************************The information contained in this message is likely to be confidential. It is intended only for the person named above. Any dissemination, distribution, copying, disclosure or use of this message or its contents unless authorised by BioWisdom Ltd is strictly prohibited. Any views or opinions expressed within this e- mail are those of the author and do not necessarily represent those of BioWisdom Ltd. If you have received this message in error, please immediately notify us and delete it. Thank you. Registered Office: BioWisdom Ltd, Harston Mill, Harston, Cambridge, CB22 7GG. Registered in England: (GB) 3861669. VAT registered: (GB) 750899881. Tel: +44 (0)1223 874800, Fax: +44 (0) 1223 874801, Internet:www.biowisdom.com*********************************************