hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pi Song (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (PIG-118) UNION/CROSS/JOIN operations should not allow 1 operand
Date Thu, 28 Feb 2008 13:01:52 GMT

    [ https://issues.apache.org/jira/browse/PIG-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573261#action_12573261
] 

pi_song edited comment on PIG-118 at 2/28/08 5:00 AM:
------------------------------------------------------

This patch solves the above issue.

All unit tests passed.

I assume Sigma-styled Union/Cross/Join are not in the plan.

      was (Author: pi_song):
    This patch solves the above issue.

All unit test passed.

I assume Sigma-styled Union/Cross/Join are not in the plan.
  
> UNION/CROSS/JOIN operations should not allow 1 operand
> ------------------------------------------------------
>
>                 Key: PIG-118
>                 URL: https://issues.apache.org/jira/browse/PIG-118
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.0.0
>            Reporter: Pi Song
>         Attachments: pig_1operand.patch
>
>
> At the moment UNION/CROSS/JOIN allow 1 operand.
> You can write:-
> {noformat}
> b = UNION a ;
> c = CROSS b ;
> d = JOIN c BY $0 ;
> {noformat}
> Possibly UNION with 1 operand might be needed for implementing Sigma-styled union (Ui=1..n
An)  but for CROSS/JOIN I think nobody would do such operation.
> By simply replacing "*" with "+" in the parser tree should fix this problem. Should this
be fixed?
> {noformat}
> LogicalOperator CrossClause() : {LogicalOperator op; ArrayList<OperatorKey> inputs
= new ArrayList<OperatorKey>();}
> {
> 	(
> 	op = NestedExpr() { inputs.add(op.getOperatorKey()); }
> 	("," op = NestedExpr() { inputs.add(op.getOperatorKey()); })*
> 	)
> 	{return rewriteCross(inputs);}
> }
> LogicalOperator JoinClause() : {CogroupInput gi; ArrayList<CogroupInput> gis =
new ArrayList<CogroupInput>();}
> {
> 	(gi = GroupItem() { gis.add(gi); }
> 	("," gi = GroupItem() { gis.add(gi); })*)
> 	{return rewriteJoin(gis);}
> }
> LogicalOperator UnionClause() : {LogicalOperator op; ArrayList<OperatorKey> inputs
= new ArrayList<OperatorKey>();}
> {
> 	(op = NestedExpr() { inputs.add(op.getOperatorKey()); }
> 	("," op = NestedExpr() { inputs.add(op.getOperatorKey()); })*)
> 	{return new LOUnion(opTable, scope, getNextId(), inputs);}
> }
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message