pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1568903 - in /pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez: TezCompiler.java TezDagBuilder.java
Date Mon, 17 Feb 2014 08:31:28 GMT
Author: daijy
Date: Mon Feb 17 08:31:27 2014
New Revision: 1568903

URL: http://svn.apache.org/r1568903
Log:
PIG-3758: Fix desc order by in Tez

Modified:
    pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezCompiler.java
    pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java

Modified: pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezCompiler.java
URL: http://svn.apache.org/viewvc/pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezCompiler.java?rev=1568903&r1=1568902&r2=1568903&view=diff
==============================================================================
--- pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezCompiler.java
(original)
+++ pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezCompiler.java
Mon Feb 17 08:31:27 2014
@@ -1712,9 +1712,21 @@ public class TezCompiler extends PhyPlan
         tezPlan.add(oper1);
         opers[0] = oper1;
 
+        POIdentityInOutTez identityInOutTez = new POIdentityInOutTez(
+                OperatorKey.genOpKey(scope),
+                inputOperRearrange);
+        identityInOutTez.setInputKey(inputOper.getOperatorKey().toString());
+        oper1.plan.addAsLeaf(identityInOutTez);
+        oper1.setClosed(true);
+
+        TezOperator oper2 = getTezOp();
+        oper2.setGlobalSort(true);
+        opers[1] = oper2;
+        tezPlan.add(oper2);
+        
         long limit = sort.getLimit();
         //TODO: TezOperator limit not used at all
-        oper1.limit = limit;
+        oper2.limit = limit;
 
         boolean[] sortOrder;
 
@@ -1724,20 +1736,9 @@ public class TezCompiler extends PhyPlan
             for(int i = 0; i < sortOrderList.size(); ++i) {
                 sortOrder[i] = sortOrderList.get(i);
             }
-            oper1.setSortOrder(sortOrder);
+            oper2.setSortOrder(sortOrder);
         }
-
-        POIdentityInOutTez identityInOutTez = new POIdentityInOutTez(
-                OperatorKey.genOpKey(scope),
-                inputOperRearrange);
-        identityInOutTez.setInputKey(inputOper.getOperatorKey().toString());
-        oper1.plan.addAsLeaf(identityInOutTez);
-        oper1.setClosed(true);
-
-        TezOperator oper2 = getTezOp();
-        oper2.setGlobalSort(true);
-        opers[1] = oper2;
-        tezPlan.add(oper2);
+        
         identityInOutTez.setOutputKey(oper2.getOperatorKey().toString());
 
         if (limit!=-1) {

Modified: pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
URL: http://svn.apache.org/viewvc/pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java?rev=1568903&r1=1568902&r2=1568903&view=diff
==============================================================================
--- pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
(original)
+++ pig/branches/tez/src/org/apache/pig/backend/hadoop/executionengine/tez/TezDagBuilder.java
Mon Feb 17 08:31:27 2014
@@ -223,11 +223,9 @@ public class TezDagBuilder extends TezOp
         conf.setBoolean("mapred.mapper.new-api", true);
         conf.set("pig.pigContext", ObjectSerializer.serialize(pc));
 
-        if(from.isGlobalSort() || from.isLimitAfterSort()){
-            if (from.isGlobalSort()) {
-                conf.set("pig.sortOrder",
-                        ObjectSerializer.serialize(from.getSortOrder()));
-            }
+        if(to.isGlobalSort() || to.isLimitAfterSort()){
+            conf.set("pig.sortOrder",
+                    ObjectSerializer.serialize(to.getSortOrder()));
         }
 
         if (edge.isUseSecondaryKey()) {



Mime
View raw message