Author: olga
Date: Mon Sep 22 17:57:03 2008
New Revision: 698051

URL: http://svn.apache.org/viewvc?rev=698051&view=rev
Log:
PIG-448: load with schema followed by explain gives and exception

Modified:
    incubator/pig/branches/types/CHANGES.txt
    incubator/pig/branches/types/src/org/apache/pig/PigServer.java

Modified: incubator/pig/branches/types/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/CHANGES.txt?rev=698051&r1=698050&r2=698051&view=diff
==============================================================================
--- incubator/pig/branches/types/CHANGES.txt (original)
+++ incubator/pig/branches/types/CHANGES.txt Mon Sep 22 17:57:03 2008
@@ -236,4 +236,6 @@
 
     PIG-444: job.jar is left behined (pradeepk via olgan)
 
-    PIG-447: improved error messages
+    PIG-447: improved error messages (pradeepk via olgan)
+
+    PIG-448: explain broken after load with types (pradeepk via olgan)

Modified: incubator/pig/branches/types/src/org/apache/pig/PigServer.java
URL: 
http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/PigServer.java?rev=698051&r1=698050&r2=698051&view=diff
==============================================================================
--- incubator/pig/branches/types/src/org/apache/pig/PigServer.java (original)
+++ incubator/pig/branches/types/src/org/apache/pig/PigServer.java Mon Sep 22 
17:57:03 2008
@@ -471,10 +471,14 @@
             // figure out the leaf to which the store needs to be added
             List<LogicalOperator> leaves = lp.getLeaves();
             LogicalOperator leaf = null;
-            for (Iterator<LogicalOperator> it = leaves.iterator(); 
it.hasNext();) {
-                LogicalOperator leafOp = it.next();
-                if(leafOp.getAlias().equals(alias))
-                    leaf = leafOp;
+            if(leaves.size() == 1) {
+                leaf = leaves.get(0);
+            } else {
+                for (Iterator<LogicalOperator> it = leaves.iterator(); 
it.hasNext();) {
+                    LogicalOperator leafOp = it.next();
+                    if(leafOp.getAlias().equals(alias))
+                        leaf = leafOp;
+                }
             }
             
             LogicalPlan storePlan = QueryParser.generateStorePlan(


Reply via email to