Author: olga
Date: Fri Sep 12 11:19:06 2008
New Revision: 694763

URL: http://svn.apache.org/viewvc?rev=694763&view=rev
Log:
PIG-422: cross is broken

Modified:
    incubator/pig/branches/types/CHANGES.txt
    
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/LogToPhyTranslationVisitor.java

Modified: incubator/pig/branches/types/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/CHANGES.txt?rev=694763&r1=694762&r2=694763&view=diff
==============================================================================
--- incubator/pig/branches/types/CHANGES.txt (original)
+++ incubator/pig/branches/types/CHANGES.txt Fri Sep 12 11:19:06 2008
@@ -188,4 +188,5 @@
 
     PIG-415: problem with comparators (shravanmn via olgan)
 
+    PIG-422: cross is broken (shravanmn via olgan)
 

Modified: 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/LogToPhyTranslationVisitor.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/LogToPhyTranslationVisitor.java?rev=694763&r1=694762&r2=694763&view=diff
==============================================================================
--- 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/LogToPhyTranslationVisitor.java
 (original)
+++ 
incubator/pig/branches/types/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/LogToPhyTranslationVisitor.java
 Fri Sep 12 11:19:06 2008
@@ -531,17 +531,29 @@
                 List<PhysicalOperator> pop = 
Arrays.asList(LogToPhyMap.get(op));
                 PhysicalPlan fep1 = new PhysicalPlan();
                 ConstantExpression ce1 = new ConstantExpression(new 
OperatorKey(scope, nodeGen.getNextNodeId(scope)),cs.getRequestedParallelism());
-                Tuple ce1val = TupleFactory.getInstance().newTuple(2);
+                ce1.setValue(inputs.size());
+                ce1.setResultType(DataType.INTEGER);
+                fep1.add(ce1);
+                
+                ConstantExpression ce2 = new ConstantExpression(new 
OperatorKey(scope, nodeGen.getNextNodeId(scope)),cs.getRequestedParallelism());
+                ce2.setValue(count);
+                ce2.setResultType(DataType.INTEGER);
+                fep1.add(ce2);
+                /*Tuple ce1val = TupleFactory.getInstance().newTuple(2);
                 ce1val.set(0,inputs.size());
                 ce1val.set(1,count);
                 ce1.setValue(ce1val);
-                ce1.setResultType(DataType.TUPLE);
+                ce1.setResultType(DataType.TUPLE);*/
+                
                 
-                fep1.add(ce1);
 
-                POUserFunc gfc = new POUserFunc(new OperatorKey(scope, 
nodeGen.getNextNodeId(scope)),cs.getRequestedParallelism(), 
Arrays.asList((PhysicalOperator)ce1), new FuncSpec(GFCross.class.getName()));
+                POUserFunc gfc = new POUserFunc(new OperatorKey(scope, 
nodeGen.getNextNodeId(scope)),cs.getRequestedParallelism(), 
Arrays.asList((PhysicalOperator)ce1,(PhysicalOperator)ce2), new 
FuncSpec(GFCross.class.getName()));
                 gfc.setResultType(DataType.BAG);
                 fep1.addAsLeaf(gfc);
+                
gfc.setInputs(Arrays.asList((PhysicalOperator)ce1,(PhysicalOperator)ce2));
+                /*fep1.add(gfc);
+                fep1.connect(ce1, gfc);
+                fep1.connect(ce2, gfc);*/
                 
                 PhysicalPlan fep2 = new PhysicalPlan();
                 POProject feproj = new POProject(new OperatorKey(scope, 
nodeGen.getNextNodeId(scope)), cs.getRequestedParallelism());
@@ -582,9 +594,6 @@
             log.error("Invalid physical operators in the physical plan"
                     + e1.getMessage());
             throw new VisitorException(e1);
-        } catch (ExecException e) {
-            log.error("Unable to create the constant tuple because " + 
e.getMessage());
-            throw new VisitorException(e);
         }
         
         poPackage.setKeyType(DataType.TUPLE);


Reply via email to