|
Russell Jurney
2012-07-20, 02:34
Russell Jurney
2012-07-20, 02:46
Robert Yerex
2012-07-20, 03:00
Russell Jurney
2012-07-20, 03:39
Bill Graham
2012-07-20, 04:49
Russell Jurney
2012-07-20, 05:10
Bill Graham
2012-07-20, 05:34
Dmitriy Ryaboy
2012-07-20, 07:53
Alan Gates
2012-07-20, 16:01
Sean Timm
2012-07-23, 21:36
Russell Jurney
2012-07-23, 21:48
Russell Jurney
2012-07-24, 08:11
|
-
Can't JOIN self?Russell Jurney 2012-07-20, 02:34
I have a problem where I can't join a relation to itself on a different
field. describe pairs pairs: {from: chararray,to: chararray,message_id: chararray,in_reply_to: chararray} pairs2 = pairs; with_reply = join pairs by in_reply_to, pairs2 by message_id; I get this error: 2012-07-19 19:31:16,927 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: Pig script failed to parse: <line 20, column 6> pig script failed to validate: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection with nothing to reference! 2012-07-19 19:31:16,928 [main] ERROR org.apache.pig.tools.grunt.Grunt - Failed to parse: Pig script failed to parse: <line 20, column 6> pig script failed to validate: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection with nothing to reference! at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) at org.apache.pig.PigServer.registerQuery(PigServer.java:540) at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) at org.apache.pig.Main.run(Main.java:490) at org.apache.pig.Main.main(Main.java:111) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.hadoop.util.RunJar.main(RunJar.java:156) Caused by: <line 20, column 6> pig script failed to validate: org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection with nothing to reference! at org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) at org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789) at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507) at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382) at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175) ... 15 more What am I to do? -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-20, 02:34
-
Re: Can't JOIN self?Russell Jurney 2012-07-20, 02:46
Note: this works if I LOAD a new, 2nd relation and do the join.
On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney <[EMAIL PROTECTED]>wrote: > I have a problem where I can't join a relation to itself on a different > field. > > describe pairs > pairs: {from: chararray,to: chararray,message_id: chararray,in_reply_to: > chararray} > > pairs2 = pairs; > > with_reply = join pairs by in_reply_to, pairs2 by message_id; > > > I get this error: > > 2012-07-19 19:31:16,927 [main] ERROR org.apache.pig.tools.grunt.Grunt - > ERROR 1200: Pig script failed to parse: > <line 20, column 6> pig script failed to validate: > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection > with nothing to reference! > 2012-07-19 19:31:16,928 [main] ERROR org.apache.pig.tools.grunt.Grunt - > Failed to parse: Pig script failed to parse: > <line 20, column 6> pig script failed to validate: > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection > with nothing to reference! > at > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) > at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) > at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) > at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) > at > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) > at > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) > at > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) > at org.apache.pig.Main.run(Main.java:490) > at org.apache.pig.Main.main(Main.java:111) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > Caused by: > <line 20, column 6> pig script failed to validate: > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: Projection > with nothing to reference! > at > org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) > at > org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) > at > org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) > at > org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789) > at > org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507) > at > org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382) > at > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175) > ... 15 more > > > What am I to do? > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome. > com > -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-20, 02:46
-
Re: Can't JOIN self?Robert Yerex 2012-07-20, 03:00
The only way to get it to work is to load a second copy.
On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney <[EMAIL PROTECTED]>wrote: > Note: this works if I LOAD a new, 2nd relation and do the join. > > On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney <[EMAIL PROTECTED] > >wrote: > > > I have a problem where I can't join a relation to itself on a different > > field. > > > > describe pairs > > pairs: {from: chararray,to: chararray,message_id: chararray,in_reply_to: > > chararray} > > > > pairs2 = pairs; > > > > with_reply = join pairs by in_reply_to, pairs2 by message_id; > > > > > > I get this error: > > > > 2012-07-19 19:31:16,927 [main] ERROR org.apache.pig.tools.grunt.Grunt - > > ERROR 1200: Pig script failed to parse: > > <line 20, column 6> pig script failed to validate: > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > Projection > > with nothing to reference! > > 2012-07-19 19:31:16,928 [main] ERROR org.apache.pig.tools.grunt.Grunt - > > Failed to parse: Pig script failed to parse: > > <line 20, column 6> pig script failed to validate: > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > Projection > > with nothing to reference! > > at > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) > > at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) > > at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) > > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) > > at > org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) > > at > > > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) > > at > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) > > at > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) > > at org.apache.pig.Main.run(Main.java:490) > > at org.apache.pig.Main.main(Main.java:111) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:597) > > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > > Caused by: > > <line 20, column 6> pig script failed to validate: > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > Projection > > with nothing to reference! > > at > > > org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) > > at > > > org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) > > at > > > org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) > > at > > > org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789) > > at > > > org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507) > > at > > > org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382) > > at > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175) > > ... 15 more > > > > > > What am I to do? > > -- > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED]atasyndrome. > > com > > > > > > -- > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] > datasyndrome.com > -- Robert Yerex Data Scientist Civitas Learning www.civitaslearning.com +
Robert Yerex 2012-07-20, 03:00
-
Re: Can't JOIN self?Russell Jurney 2012-07-20, 03:39
Is this a bug?
On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < [EMAIL PROTECTED]> wrote: > The only way to get it to work is to load a second copy. > > On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney <[EMAIL PROTECTED] > >wrote: > > > Note: this works if I LOAD a new, 2nd relation and do the join. > > > > On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < > [EMAIL PROTECTED] > > >wrote: > > > > > I have a problem where I can't join a relation to itself on a different > > > field. > > > > > > describe pairs > > > pairs: {from: chararray,to: chararray,message_id: > chararray,in_reply_to: > > > chararray} > > > > > > pairs2 = pairs; > > > > > > with_reply = join pairs by in_reply_to, pairs2 by message_id; > > > > > > > > > I get this error: > > > > > > 2012-07-19 19:31:16,927 [main] ERROR org.apache.pig.tools.grunt.Grunt - > > > ERROR 1200: Pig script failed to parse: > > > <line 20, column 6> pig script failed to validate: > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > Projection > > > with nothing to reference! > > > 2012-07-19 19:31:16,928 [main] ERROR org.apache.pig.tools.grunt.Grunt - > > > Failed to parse: Pig script failed to parse: > > > <line 20, column 6> pig script failed to validate: > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > Projection > > > with nothing to reference! > > > at > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) > > > at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) > > > at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) > > > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) > > > at > > org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) > > > at > > > > > > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) > > > at > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) > > > at > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > > > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) > > > at org.apache.pig.Main.run(Main.java:490) > > > at org.apache.pig.Main.main(Main.java:111) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > at > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > > > Caused by: > > > <line 20, column 6> pig script failed to validate: > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > Projection > > > with nothing to reference! > > > at > > > > > > org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) > > > at > > > > > > org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) > > > at > > > > > > org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) > > > at > > > > > > org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789) > > > at > > > > > > org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507) > > > at > > > > > > org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382) > > > at > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175) > > > ... 15 more > > > > > > > > > What am I to do? > > > -- > > > Russell Jurney twitter.com/[EMAIL PROTECTED]atasyndrome. > > > com > > > > > > > > > > > -- > > Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] > > datasyndrome.com > > > > > > -- > Robert Yerex > Data Scientist > Civitas Learning > www.civitaslearning.com > -- Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-20, 03:39
-
Re: Can't JOIN self?Bill Graham 2012-07-20, 04:49
No, to Pig a self join is just like a regular join across two different
relations. It just happens to be to the same input data. On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED]>wrote: > Is this a bug? > > On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < > [EMAIL PROTECTED]> wrote: > > > The only way to get it to work is to load a second copy. > > > > On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < > [EMAIL PROTECTED] > > >wrote: > > > > > Note: this works if I LOAD a new, 2nd relation and do the join. > > > > > > On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < > > [EMAIL PROTECTED] > > > >wrote: > > > > > > > I have a problem where I can't join a relation to itself on a > different > > > > field. > > > > > > > > describe pairs > > > > pairs: {from: chararray,to: chararray,message_id: > > chararray,in_reply_to: > > > > chararray} > > > > > > > > pairs2 = pairs; > > > > > > > > with_reply = join pairs by in_reply_to, pairs2 by message_id; > > > > > > > > > > > > I get this error: > > > > > > > > 2012-07-19 19:31:16,927 [main] ERROR > org.apache.pig.tools.grunt.Grunt - > > > > ERROR 1200: Pig script failed to parse: > > > > <line 20, column 6> pig script failed to validate: > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > Projection > > > > with nothing to reference! > > > > 2012-07-19 19:31:16,928 [main] ERROR > org.apache.pig.tools.grunt.Grunt - > > > > Failed to parse: Pig script failed to parse: > > > > <line 20, column 6> pig script failed to validate: > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > Projection > > > > with nothing to reference! > > > > at > > > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) > > > > at org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) > > > > at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) > > > > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) > > > > at > > > org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) > > > > at > > > > > > > > > > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) > > > > at > > > > > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) > > > > at > > > > > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > > > > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) > > > > at org.apache.pig.Main.run(Main.java:490) > > > > at org.apache.pig.Main.main(Main.java:111) > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > at > > > > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > > at > > > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > > > > Caused by: > > > > <line 20, column 6> pig script failed to validate: > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > Projection > > > > with nothing to reference! > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789) > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507) > > > > at > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382) > > > > at > > > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175) *Note that I'm no longer using my Yahoo! email address. Please email me at [EMAIL PROTECTED] going forward.* +
Bill Graham 2012-07-20, 04:49
-
Re: Can't JOIN self?Russell Jurney 2012-07-20, 05:10
So it is a bug? Because Pig will not let me self JOIN. I have to LOAD the
data twice. On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> wrote: > No, to Pig a self join is just like a regular join across two different > relations. It just happens to be to the same input data. > > On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED] > >wrote: > > > Is this a bug? > > > > On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < > > [EMAIL PROTECTED]> wrote: > > > > > The only way to get it to work is to load a second copy. > > > > > > On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < > > [EMAIL PROTECTED] > > > >wrote: > > > > > > > Note: this works if I LOAD a new, 2nd relation and do the join. > > > > > > > > On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < > > > [EMAIL PROTECTED] > > > > >wrote: > > > > > > > > > I have a problem where I can't join a relation to itself on a > > different > > > > > field. > > > > > > > > > > describe pairs > > > > > pairs: {from: chararray,to: chararray,message_id: > > > chararray,in_reply_to: > > > > > chararray} > > > > > > > > > > pairs2 = pairs; > > > > > > > > > > with_reply = join pairs by in_reply_to, pairs2 by message_id; > > > > > > > > > > > > > > > I get this error: > > > > > > > > > > 2012-07-19 19:31:16,927 [main] ERROR > > org.apache.pig.tools.grunt.Grunt - > > > > > ERROR 1200: Pig script failed to parse: > > > > > <line 20, column 6> pig script failed to validate: > > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > > Projection > > > > > with nothing to reference! > > > > > 2012-07-19 19:31:16,928 [main] ERROR > > org.apache.pig.tools.grunt.Grunt - > > > > > Failed to parse: Pig script failed to parse: > > > > > <line 20, column 6> pig script failed to validate: > > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > > Projection > > > > > with nothing to reference! > > > > > at > > > > > > > > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) > > > > > at > org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) > > > > > at > org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) > > > > > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) > > > > > at > > > > > org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) > > > > > at > > > > > > > > > > > > > > > org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) > > > > > at > > > > > > > > > > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) > > > > > at > > > > > > > > > > > > > > > org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) > > > > > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) > > > > > at org.apache.pig.Main.run(Main.java:490) > > > > > at org.apache.pig.Main.main(Main.java:111) > > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > > > at > > > > > > > > > > > > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > > > at > > > > > > > > > > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > > > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) > > > > > Caused by: > > > > > <line 20, column 6> pig script failed to validate: > > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: > > > > Projection > > > > > with nothing to reference! > > > > > at > > > > > > > > > > > > > > > org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) > > > > > at > > > > > > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.join_clause(LogicalPlanGenerator.java:11354) > > > > > at > > > > > > > > > > > > > > > org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1489) > > > > > at Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-20, 05:10
-
Re: Can't JOIN self?Bill Graham 2012-07-20, 05:34
No, it isn't a bug as I see it. You need to load the two relations
separately because a join is across two separate data sources. On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney <[EMAIL PROTECTED]>wrote: > So it is a bug? Because Pig will not let me self JOIN. I have to LOAD the > data twice. > > On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> wrote: > >> No, to Pig a self join is just like a regular join across two different >> relations. It just happens to be to the same input data. >> >> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED] >> >wrote: >> >> > Is this a bug? >> > >> > On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >> > [EMAIL PROTECTED]> wrote: >> > >> > > The only way to get it to work is to load a second copy. >> > > >> > > On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >> > [EMAIL PROTECTED] >> > > >wrote: >> > > >> > > > Note: this works if I LOAD a new, 2nd relation and do the join. >> > > > >> > > > On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >> > > [EMAIL PROTECTED] >> > > > >wrote: >> > > > >> > > > > I have a problem where I can't join a relation to itself on a >> > different >> > > > > field. >> > > > > >> > > > > describe pairs >> > > > > pairs: {from: chararray,to: chararray,message_id: >> > > chararray,in_reply_to: >> > > > > chararray} >> > > > > >> > > > > pairs2 = pairs; >> > > > > >> > > > > with_reply = join pairs by in_reply_to, pairs2 by message_id; >> > > > > >> > > > > >> > > > > I get this error: >> > > > > >> > > > > 2012-07-19 19:31:16,927 [main] ERROR >> > org.apache.pig.tools.grunt.Grunt - >> > > > > ERROR 1200: Pig script failed to parse: >> > > > > <line 20, column 6> pig script failed to validate: >> > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >> > > > Projection >> > > > > with nothing to reference! >> > > > > 2012-07-19 19:31:16,928 [main] ERROR >> > org.apache.pig.tools.grunt.Grunt - >> > > > > Failed to parse: Pig script failed to parse: >> > > > > <line 20, column 6> pig script failed to validate: >> > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >> > > > Projection >> > > > > with nothing to reference! >> > > > > at >> > > > > >> > > >> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) >> > > > > at >> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) >> > > > > at >> org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) >> > > > > at org.apache.pig.PigServer.registerQuery(PigServer.java:540) >> > > > > at >> > > > >> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) >> > > > > at >> > > > > >> > > > >> > > >> > >> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) >> > > > > at >> > > > > >> > > > >> > > >> > >> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) >> > > > > at >> > > > > >> > > > >> > > >> > >> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) >> > > > > at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) >> > > > > at org.apache.pig.Main.run(Main.java:490) >> > > > > at org.apache.pig.Main.main(Main.java:111) >> > > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> > > > > at >> > > > > >> > > > >> > > >> > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> > > > > at >> > > > > >> > > > >> > > >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> > > > > at java.lang.reflect.Method.invoke(Method.java:597) >> > > > > at org.apache.hadoop.util.RunJar.main(RunJar.java:156) >> > > > > Caused by: >> > > > > <line 20, column 6> pig script failed to validate: >> > > > > org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >> > > > Projection >> > > > > with nothing to reference! >> > > > > at >> > > > > >> > > > >> > > >> > >> org.apache.pig.parser.LogicalPlanBuilder.buildJoinOp(LogicalPlanBuilder.java:363) *Note that I'm no longer using my Yahoo! email address. Please email me at [EMAIL PROTECTED] going forward.* +
Bill Graham 2012-07-20, 05:34
-
Re: Can't JOIN self?Dmitriy Ryaboy 2012-07-20, 07:53
It's kind if a waste of io and mappers. If not a bug, it's an optimization opportunity.
On Jul 19, 2012, at 10:34 PM, Bill Graham <[EMAIL PROTECTED]> wrote: > No, it isn't a bug as I see it. You need to load the two relations > separately because a join is across two separate data sources. > > > On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney > <[EMAIL PROTECTED]>wrote: > >> So it is a bug? Because Pig will not let me self JOIN. I have to LOAD the >> data twice. >> >> On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >> >>> No, to Pig a self join is just like a regular join across two different >>> relations. It just happens to be to the same input data. >>> >>> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED] >>>> wrote: >>> >>>> Is this a bug? >>>> >>>> On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >>>> [EMAIL PROTECTED]> wrote: >>>> >>>>> The only way to get it to work is to load a second copy. >>>>> >>>>> On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >>>> [EMAIL PROTECTED] >>>>>> wrote: >>>>> >>>>>> Note: this works if I LOAD a new, 2nd relation and do the join. >>>>>> >>>>>> On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >>>>> [EMAIL PROTECTED] >>>>>>> wrote: >>>>>> >>>>>>> I have a problem where I can't join a relation to itself on a >>>> different >>>>>>> field. >>>>>>> >>>>>>> describe pairs >>>>>>> pairs: {from: chararray,to: chararray,message_id: >>>>> chararray,in_reply_to: >>>>>>> chararray} >>>>>>> >>>>>>> pairs2 = pairs; >>>>>>> >>>>>>> with_reply = join pairs by in_reply_to, pairs2 by message_id; >>>>>>> >>>>>>> >>>>>>> I get this error: >>>>>>> >>>>>>> 2012-07-19 19:31:16,927 [main] ERROR >>>> org.apache.pig.tools.grunt.Grunt - >>>>>>> ERROR 1200: Pig script failed to parse: >>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>> Projection >>>>>>> with nothing to reference! >>>>>>> 2012-07-19 19:31:16,928 [main] ERROR >>>> org.apache.pig.tools.grunt.Grunt - >>>>>>> Failed to parse: Pig script failed to parse: >>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>> Projection >>>>>>> with nothing to reference! >>>>>>> at >>>>>>> >>>>> >>> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) >>>>>>> at >>> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) >>>>>>> at >>> org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) >>>>>>> at org.apache.pig.PigServer.registerQuery(PigServer.java:540) >>>>>>> at >>>>>> >>> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) >>>>>>> at >>>>>>> >>>>>> >>>>> >>>> >>> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) >>>>>>> at >>>>>>> >>>>>> >>>>> >>>> >>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) >>>>>>> at >>>>>>> >>>>>> >>>>> >>>> >>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) >>>>>>> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) >>>>>>> at org.apache.pig.Main.run(Main.java:490) >>>>>>> at org.apache.pig.Main.main(Main.java:111) >>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>>>>>> at >>>>>>> >>>>>> >>>>> >>>> >>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >>>>>>> at >>>>>>> >>>>>> >>>>> >>>> >>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >>>>>>> at java.lang.reflect.Method.invoke(Method.java:597) >>>>>>> at org.apache.hadoop.util.RunJar.main(RunJar.java:156) >>>>>>> Caused by: >>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>> Projection >>>>>>> with nothing to reference! >>>>>>> at >>>>>>> >>>>>> > +
Dmitriy Ryaboy 2012-07-20, 07:53
-
Re: Can't JOIN self?Alan Gates 2012-07-20, 16:01
It isn't a bug that you need to declare the join twice in your script. That is necessary for clarity and semantic correctness. That is, if we allowed:
A = load 'bla'; B = join A by user, A by user; then you'd have two user fields in the B with no way to disambiguate. What's a bug (or missed optimization opportunity) is that we actually double read and shuffle the data. We could optimize here and only read shuffle one copy and then do the join in the reduce. Alan. On Jul 20, 2012, at 12:53 AM, Dmitriy Ryaboy wrote: > It's kind if a waste of io and mappers. If not a bug, it's an optimization opportunity. > > On Jul 19, 2012, at 10:34 PM, Bill Graham <[EMAIL PROTECTED]> wrote: > >> No, it isn't a bug as I see it. You need to load the two relations >> separately because a join is across two separate data sources. >> >> >> On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney >> <[EMAIL PROTECTED]>wrote: >> >>> So it is a bug? Because Pig will not let me self JOIN. I have to LOAD the >>> data twice. >>> >>> On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >>> >>>> No, to Pig a self join is just like a regular join across two different >>>> relations. It just happens to be to the same input data. >>>> >>>> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED] >>>>> wrote: >>>> >>>>> Is this a bug? >>>>> >>>>> On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >>>>> [EMAIL PROTECTED]> wrote: >>>>> >>>>>> The only way to get it to work is to load a second copy. >>>>>> >>>>>> On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >>>>> [EMAIL PROTECTED] >>>>>>> wrote: >>>>>> >>>>>>> Note: this works if I LOAD a new, 2nd relation and do the join. >>>>>>> >>>>>>> On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >>>>>> [EMAIL PROTECTED] >>>>>>>> wrote: >>>>>>> >>>>>>>> I have a problem where I can't join a relation to itself on a >>>>> different >>>>>>>> field. >>>>>>>> >>>>>>>> describe pairs >>>>>>>> pairs: {from: chararray,to: chararray,message_id: >>>>>> chararray,in_reply_to: >>>>>>>> chararray} >>>>>>>> >>>>>>>> pairs2 = pairs; >>>>>>>> >>>>>>>> with_reply = join pairs by in_reply_to, pairs2 by message_id; >>>>>>>> >>>>>>>> >>>>>>>> I get this error: >>>>>>>> >>>>>>>> 2012-07-19 19:31:16,927 [main] ERROR >>>>> org.apache.pig.tools.grunt.Grunt - >>>>>>>> ERROR 1200: Pig script failed to parse: >>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>>> Projection >>>>>>>> with nothing to reference! >>>>>>>> 2012-07-19 19:31:16,928 [main] ERROR >>>>> org.apache.pig.tools.grunt.Grunt - >>>>>>>> Failed to parse: Pig script failed to parse: >>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>>> Projection >>>>>>>> with nothing to reference! >>>>>>>> at >>>>>>>> >>>>>> >>>> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) >>>>>>>> at >>>> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) >>>>>>>> at >>>> org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) >>>>>>>> at org.apache.pig.PigServer.registerQuery(PigServer.java:540) >>>>>>>> at >>>>>>> >>>> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) >>>>>>>> at >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) >>>>>>>> at >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) >>>>>>>> at >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) >>>>>>>> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) >>>>>>>> at org.apache.pig.Main.run(Main.java:490) >>>>>>>> at org.apache.pig.Main.main(Main.java:111) >>>>>>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) +
Alan Gates 2012-07-20, 16:01
-
Re: Can't JOIN self?Sean Timm 2012-07-23, 21:36
It seem the self join should work in Pig 0.10 if using an alias, but
alas it doesn't. See Jira PIG-2630. https://issues.apache.org/jira/browse/PIG-2630 -Sean On 7/20/2012 12:01 PM, Alan Gates wrote: > It isn't a bug that you need to declare the join twice in your script. That is necessary for clarity and semantic correctness. That is, if we allowed: > > A = load 'bla'; > B = join A by user, A by user; > > then you'd have two user fields in the B with no way to disambiguate. What's a bug (or missed optimization opportunity) is that we actually double read and shuffle the data. We could optimize here and only read shuffle one copy and then do the join in the reduce. > > Alan. > > On Jul 20, 2012, at 12:53 AM, Dmitriy Ryaboy wrote: > >> It's kind if a waste of io and mappers. If not a bug, it's an optimization opportunity. >> >> On Jul 19, 2012, at 10:34 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >> >>> No, it isn't a bug as I see it. You need to load the two relations >>> separately because a join is across two separate data sources. >>> >>> >>> On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney >>> <[EMAIL PROTECTED]>wrote: >>> >>>> So it is a bug? Because Pig will not let me self JOIN. I have to LOAD the >>>> data twice. >>>> >>>> On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >>>> >>>>> No, to Pig a self join is just like a regular join across two different >>>>> relations. It just happens to be to the same input data. >>>>> >>>>> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney <[EMAIL PROTECTED] >>>>>> wrote: >>>>>> Is this a bug? >>>>>> >>>>>> On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >>>>>> [EMAIL PROTECTED]> wrote: >>>>>> >>>>>>> The only way to get it to work is to load a second copy. >>>>>>> >>>>>>> On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >>>>>> [EMAIL PROTECTED] >>>>>>>> wrote: >>>>>>>> Note: this works if I LOAD a new, 2nd relation and do the join. >>>>>>>> >>>>>>>> On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >>>>>>> [EMAIL PROTECTED] >>>>>>>>> wrote: >>>>>>>>> I have a problem where I can't join a relation to itself on a >>>>>> different >>>>>>>>> field. >>>>>>>>> >>>>>>>>> describe pairs >>>>>>>>> pairs: {from: chararray,to: chararray,message_id: >>>>>>> chararray,in_reply_to: >>>>>>>>> chararray} >>>>>>>>> >>>>>>>>> pairs2 = pairs; >>>>>>>>> >>>>>>>>> with_reply = join pairs by in_reply_to, pairs2 by message_id; >>>>>>>>> >>>>>>>>> >>>>>>>>> I get this error: >>>>>>>>> >>>>>>>>> 2012-07-19 19:31:16,927 [main] ERROR >>>>>> org.apache.pig.tools.grunt.Grunt - >>>>>>>>> ERROR 1200: Pig script failed to parse: >>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>>>> Projection >>>>>>>>> with nothing to reference! >>>>>>>>> 2012-07-19 19:31:16,928 [main] ERROR >>>>>> org.apache.pig.tools.grunt.Grunt - >>>>>>>>> Failed to parse: Pig script failed to parse: >>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>>> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 2225: >>>>>>>> Projection >>>>>>>>> with nothing to reference! >>>>>>>>> at >>>>>>>>> >>>>> org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:182) >>>>>>>>> at >>>>> org.apache.pig.PigServer$Graph.validateQuery(PigServer.java:1565) >>>>>>>>> at >>>>> org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1538) >>>>>>>>> at org.apache.pig.PigServer.registerQuery(PigServer.java:540) >>>>>>>>> at >>>>> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970) >>>>>>>>> at >>>>>>>>> >>>>> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386) >>>>>>>>> at >>>>>>>>> >>>>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) >>>>>>>>> at >>>>>>>>> >>>>> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) >>>>>>>>> at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) +
Sean Timm 2012-07-23, 21:36
-
Re: Can't JOIN self?Russell Jurney 2012-07-23, 21:48
Thanks, that was my thinking. If I make an alias and self-JOIN to it, it
should work. Self-joins this way are really powerful. On Mon, Jul 23, 2012 at 2:36 PM, Sean Timm <[EMAIL PROTECTED]> wrote: > It seem the self join should work in Pig 0.10 if using an alias, but alas > it doesn't. See Jira PIG-2630. https://issues.apache.org/** > jira/browse/PIG-2630 <https://issues.apache.org/jira/browse/PIG-2630> > > -Sean > > > On 7/20/2012 12:01 PM, Alan Gates wrote: > >> It isn't a bug that you need to declare the join twice in your script. >> That is necessary for clarity and semantic correctness. That is, if we >> allowed: >> >> A = load 'bla'; >> B = join A by user, A by user; >> >> then you'd have two user fields in the B with no way to disambiguate. >> What's a bug (or missed optimization opportunity) is that we actually >> double read and shuffle the data. We could optimize here and only read >> shuffle one copy and then do the join in the reduce. >> >> Alan. >> >> On Jul 20, 2012, at 12:53 AM, Dmitriy Ryaboy wrote: >> >> It's kind if a waste of io and mappers. If not a bug, it's an >>> optimization opportunity. >>> >>> On Jul 19, 2012, at 10:34 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >>> >>> No, it isn't a bug as I see it. You need to load the two relations >>>> separately because a join is across two separate data sources. >>>> >>>> >>>> On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney >>>> <[EMAIL PROTECTED]>**wrote: >>>> >>>> So it is a bug? Because Pig will not let me self JOIN. I have to LOAD >>>>> the >>>>> data twice. >>>>> >>>>> On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> >>>>> wrote: >>>>> >>>>> No, to Pig a self join is just like a regular join across two >>>>>> different >>>>>> relations. It just happens to be to the same input data. >>>>>> >>>>>> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney < >>>>>> [EMAIL PROTECTED] >>>>>> >>>>>>> wrote: >>>>>>> Is this a bug? >>>>>>> >>>>>>> On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >>>>>>> robert.yerex@civitaslearning.**com<[EMAIL PROTECTED]>> >>>>>>> wrote: >>>>>>> >>>>>>> The only way to get it to work is to load a second copy. >>>>>>>> >>>>>>>> On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >>>>>>>> >>>>>>> [EMAIL PROTECTED] >>>>>>> >>>>>>>> wrote: >>>>>>>>> Note: this works if I LOAD a new, 2nd relation and do the join. >>>>>>>>> >>>>>>>>> On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >>>>>>>>> >>>>>>>> [EMAIL PROTECTED] >>>>>>>> >>>>>>>>> wrote: >>>>>>>>>> I have a problem where I can't join a relation to itself on a >>>>>>>>>> >>>>>>>>> different >>>>>>> >>>>>>>> field. >>>>>>>>>> >>>>>>>>>> describe pairs >>>>>>>>>> pairs: {from: chararray,to: chararray,message_id: >>>>>>>>>> >>>>>>>>> chararray,in_reply_to: >>>>>>>> >>>>>>>>> chararray} >>>>>>>>>> >>>>>>>>>> pairs2 = pairs; >>>>>>>>>> >>>>>>>>>> with_reply = join pairs by in_reply_to, pairs2 by message_id; >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> I get this error: >>>>>>>>>> >>>>>>>>>> 2012-07-19 19:31:16,927 [main] ERROR >>>>>>>>>> >>>>>>>>> org.apache.pig.tools.grunt.**Grunt - >>>>>>> >>>>>>>> ERROR 1200: Pig script failed to parse: >>>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>>>> org.apache.pig.impl.**logicalLayer.**FrontendException: ERROR >>>>>>>>>> 2225: >>>>>>>>>> >>>>>>>>> Projection >>>>>>>>> >>>>>>>>>> with nothing to reference! >>>>>>>>>> 2012-07-19 19:31:16,928 [main] ERROR >>>>>>>>>> >>>>>>>>> org.apache.pig.tools.grunt.**Grunt - >>>>>>> >>>>>>>> Failed to parse: Pig script failed to parse: >>>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>>>> org.apache.pig.impl.**logicalLayer.**FrontendException: ERROR >>>>>>>>>> 2225: >>>>>>>>>> >>>>>>>>> Projection >>>>>>>>> >>>>>>>>>> with nothing to reference! >>>>>>>>>> at >>>>>>>>>> >>>>>>>>>> org.apache.pig.parser.**QueryParserDriver.parse(** >>>>>> QueryParserDriver.java:182) >>>>>> >>>>>>> at >>>>>>>>>> >>>>>>>>> org.apache.pig.PigServer$**Graph.validateQuery(PigServer.** Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-23, 21:48
-
Re: Can't JOIN self?Russell Jurney 2012-07-24, 08:11
I'm realizing that I need to do this constantly, otherwise I can't make
much of anything. I used to do this, I think, maybe Pig let it slide. On Mon, Jul 23, 2012 at 2:48 PM, Russell Jurney <[EMAIL PROTECTED]>wrote: > Thanks, that was my thinking. If I make an alias and self-JOIN to it, it > should work. Self-joins this way are really powerful. > > > On Mon, Jul 23, 2012 at 2:36 PM, Sean Timm <[EMAIL PROTECTED]> wrote: > >> It seem the self join should work in Pig 0.10 if using an alias, but alas >> it doesn't. See Jira PIG-2630. https://issues.apache.org/** >> jira/browse/PIG-2630 <https://issues.apache.org/jira/browse/PIG-2630> >> >> -Sean >> >> >> On 7/20/2012 12:01 PM, Alan Gates wrote: >> >>> It isn't a bug that you need to declare the join twice in your script. >>> That is necessary for clarity and semantic correctness. That is, if we >>> allowed: >>> >>> A = load 'bla'; >>> B = join A by user, A by user; >>> >>> then you'd have two user fields in the B with no way to disambiguate. >>> What's a bug (or missed optimization opportunity) is that we actually >>> double read and shuffle the data. We could optimize here and only read >>> shuffle one copy and then do the join in the reduce. >>> >>> Alan. >>> >>> On Jul 20, 2012, at 12:53 AM, Dmitriy Ryaboy wrote: >>> >>> It's kind if a waste of io and mappers. If not a bug, it's an >>>> optimization opportunity. >>>> >>>> On Jul 19, 2012, at 10:34 PM, Bill Graham <[EMAIL PROTECTED]> wrote: >>>> >>>> No, it isn't a bug as I see it. You need to load the two relations >>>>> separately because a join is across two separate data sources. >>>>> >>>>> >>>>> On Thu, Jul 19, 2012 at 10:10 PM, Russell Jurney >>>>> <[EMAIL PROTECTED]>**wrote: >>>>> >>>>> So it is a bug? Because Pig will not let me self JOIN. I have to LOAD >>>>>> the >>>>>> data twice. >>>>>> >>>>>> On Thu, Jul 19, 2012 at 9:49 PM, Bill Graham <[EMAIL PROTECTED]> >>>>>> wrote: >>>>>> >>>>>> No, to Pig a self join is just like a regular join across two >>>>>>> different >>>>>>> relations. It just happens to be to the same input data. >>>>>>> >>>>>>> On Thu, Jul 19, 2012 at 8:39 PM, Russell Jurney < >>>>>>> [EMAIL PROTECTED] >>>>>>> >>>>>>>> wrote: >>>>>>>> Is this a bug? >>>>>>>> >>>>>>>> On Thu, Jul 19, 2012 at 8:00 PM, Robert Yerex < >>>>>>>> robert.yerex@civitaslearning.**com<[EMAIL PROTECTED]>> >>>>>>>> wrote: >>>>>>>> >>>>>>>> The only way to get it to work is to load a second copy. >>>>>>>>> >>>>>>>>> On Thu, Jul 19, 2012 at 7:46 PM, Russell Jurney < >>>>>>>>> >>>>>>>> [EMAIL PROTECTED] >>>>>>>> >>>>>>>>> wrote: >>>>>>>>>> Note: this works if I LOAD a new, 2nd relation and do the join. >>>>>>>>>> >>>>>>>>>> On Thu, Jul 19, 2012 at 7:34 PM, Russell Jurney < >>>>>>>>>> >>>>>>>>> [EMAIL PROTECTED] >>>>>>>>> >>>>>>>>>> wrote: >>>>>>>>>>> I have a problem where I can't join a relation to itself on a >>>>>>>>>>> >>>>>>>>>> different >>>>>>>> >>>>>>>>> field. >>>>>>>>>>> >>>>>>>>>>> describe pairs >>>>>>>>>>> pairs: {from: chararray,to: chararray,message_id: >>>>>>>>>>> >>>>>>>>>> chararray,in_reply_to: >>>>>>>>> >>>>>>>>>> chararray} >>>>>>>>>>> >>>>>>>>>>> pairs2 = pairs; >>>>>>>>>>> >>>>>>>>>>> with_reply = join pairs by in_reply_to, pairs2 by message_id; >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I get this error: >>>>>>>>>>> >>>>>>>>>>> 2012-07-19 19:31:16,927 [main] ERROR >>>>>>>>>>> >>>>>>>>>> org.apache.pig.tools.grunt.**Grunt - >>>>>>>> >>>>>>>>> ERROR 1200: Pig script failed to parse: >>>>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>>>>>>> org.apache.pig.impl.**logicalLayer.**FrontendException: ERROR >>>>>>>>>>> 2225: >>>>>>>>>>> >>>>>>>>>> Projection >>>>>>>>>> >>>>>>>>>>> with nothing to reference! >>>>>>>>>>> 2012-07-19 19:31:16,928 [main] ERROR >>>>>>>>>>> >>>>>>>>>> org.apache.pig.tools.grunt.**Grunt - >>>>>>>> >>>>>>>>> Failed to parse: Pig script failed to parse: >>>>>>>>>>> <line 20, column 6> pig script failed to validate: >>>>>> Russell Jurney twitter.com/rjurney [EMAIL PROTECTED] datasyndrome.com +
Russell Jurney 2012-07-24, 08:11
|