Author: daijy
Date: Sun Sep 26 21:15:05 2010
New Revision: 1001517

URL: http://svn.apache.org/viewvc?rev=1001517&view=rev
Log:
PIG-1643: join fails for a query with input having 'load using pigstorage 
without schema' + 'foreach'

Modified:
    hadoop/pig/branches/branch-0.8/CHANGES.txt
    
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/LogicalExpression.java
    
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/ProjectExpression.java

Modified: hadoop/pig/branches/branch-0.8/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.8/CHANGES.txt?rev=1001517&r1=1001516&r2=1001517&view=diff
==============================================================================
--- hadoop/pig/branches/branch-0.8/CHANGES.txt (original)
+++ hadoop/pig/branches/branch-0.8/CHANGES.txt Sun Sep 26 21:15:05 2010
@@ -198,6 +198,9 @@ PIG-1309: Map-side Cogroup (ashutoshc)
 
 BUG FIXES
 
+PIG-1643: join fails for a query with input having 'load using pigstorage
+without schema' + 'foreach' (daijy)
+
 PIG-1645: Using both small split combination and temporary file compression on 
a query of ORDER BY may cause crash (yanz)
 
 PIG-1635: Logical simplifier does not simplify away constants under AND and 
OR; after simplificaion the ordering of operands of

Modified: 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/LogicalExpression.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/LogicalExpression.java?rev=1001517&r1=1001516&r2=1001517&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/LogicalExpression.java
 (original)
+++ 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/LogicalExpression.java
 Sun Sep 26 21:15:05 2010
@@ -72,9 +72,9 @@ public abstract class LogicalExpression 
      * @return data type, one of the static bytes of DataType
      */
     public byte getType() throws FrontendException {
-        if (getFieldSchema()!=null)
+        if (getFieldSchema()!=null && getFieldSchema().type!=DataType.NULL)
             return getFieldSchema().type;
-        return DataType.UNKNOWN;
+        return DataType.BYTEARRAY;
     }
     
     public String toString() {

Modified: 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/ProjectExpression.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/ProjectExpression.java?rev=1001517&r1=1001516&r2=1001517&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/ProjectExpression.java
 (original)
+++ 
hadoop/pig/branches/branch-0.8/src/org/apache/pig/newplan/logical/expression/ProjectExpression.java
 Sun Sep 26 21:15:05 2010
@@ -149,11 +149,8 @@ public class ProjectExpression extends C
                 if (findReferent().getSchema()!=null)
                     fieldSchema = findReferent().getSchema().getField(0);
             }
-            if(fieldSchema == null){
-                fieldSchema = new LogicalSchema.LogicalFieldSchema(null, null, 
DataType.BYTEARRAY);
-            }
-            uidOnlyFieldSchema = fieldSchema.mergeUid(uidOnlyFieldSchema);
-            
+            if (fieldSchema!=null)
+                uidOnlyFieldSchema = fieldSchema.mergeUid(uidOnlyFieldSchema);
         }
         else {
             if (schema == null) {


Reply via email to