pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cheol...@apache.org
Subject svn commit: r1582796 - in /pig/branches/branch-0.12: CHANGES.txt src/org/apache/pig/newplan/logical/relational/LORank.java
Date Fri, 28 Mar 2014 16:16:56 GMT
Author: cheolsoo
Date: Fri Mar 28 16:16:55 2014
New Revision: 1582796

URL: http://svn.apache.org/r1582796
Log:
PIG-3813: Rank column is assigned different uids everytime when schema is reset (cheolsoo)

Modified:
    pig/branches/branch-0.12/CHANGES.txt
    pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LORank.java

Modified: pig/branches/branch-0.12/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.12/CHANGES.txt?rev=1582796&r1=1582795&r2=1582796&view=diff
==============================================================================
--- pig/branches/branch-0.12/CHANGES.txt (original)
+++ pig/branches/branch-0.12/CHANGES.txt Fri Mar 28 16:16:55 2014
@@ -34,6 +34,8 @@ PIG-3480: TFile-based tmpfile compressio
 
 BUG FIXES
 
+PIG-3813: Rank column is assigned different uids everytime when schema is reset (cheolsoo)
+
 PIG-3833: Relation loaded by AvroStorage with schema is projected incorrectly in foreach
statement (jeongjinku via cheolsoo)
 
 PIG-3794: pig -useHCatalog fails using pig command line interface on HDInsight (ehans via
daijy)

Modified: pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LORank.java
URL: http://svn.apache.org/viewvc/pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LORank.java?rev=1582796&r1=1582795&r2=1582796&view=diff
==============================================================================
--- pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LORank.java (original)
+++ pig/branches/branch-0.12/src/org/apache/pig/newplan/logical/relational/LORank.java Fri
Mar 28 16:16:55 2014
@@ -70,14 +70,23 @@ public class LORank extends LogicalRelat
      */
     private boolean isRowNumber = false;
 
+    /**
+     * This is a uid which has been generated for the rank column. It is
+     * important to keep this so that the uid be persistent between calls of
+     * resetSchema and getSchema.
+     */
+    private long rankColumnUid;
+
     public LORank( OperatorPlan plan) {
         super("LORank", plan);
+        this.rankColumnUid = -1;
     }
 
     public LORank( OperatorPlan plan, List<LogicalExpressionPlan> rankColPlans, List<Boolean>
ascCols) {
         this( plan );
         this.rankColPlans = rankColPlans;
         this.ascCols = ascCols;
+        this.rankColumnUid = -1;
     }
 
     public List<LogicalExpressionPlan> getRankColPlans() {
@@ -139,8 +148,9 @@ public class LORank extends LogicalRelat
 
         schema = new LogicalSchema();
 
-        schema.addField(new LogicalSchema.LogicalFieldSchema(RANK_COL_NAME+SEPARATOR+input.getAlias(),
null, DataType.LONG));
-        schema.getField(0).uid = LogicalExpression.getNextUid();
+        rankColumnUid = rankColumnUid == -1 ? LogicalExpression.getNextUid() : rankColumnUid;
+        schema.addField(new LogicalSchema.LogicalFieldSchema(RANK_COL_NAME + SEPARATOR +
input.getAlias(),
+                null, DataType.LONG, rankColumnUid));
 
         for(LogicalSchema.LogicalFieldSchema fieldSchema: fss) {
             schema.addField(fieldSchema);



Mime
View raw message