Author: daijy
Date: Thu Dec 17 00:13:07 2009
New Revision: 891493

URL: http://svn.apache.org/viewvc?rev=891493&view=rev
Log:
PIG-1155: Need to make sure existing loaders work 'as is'

Modified:
    hadoop/pig/branches/branch-0.6/CHANGES.txt
    
hadoop/pig/branches/branch-0.6/src/org/apache/pig/impl/logicalLayer/LOLoad.java

Modified: hadoop/pig/branches/branch-0.6/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.6/CHANGES.txt?rev=891493&r1=891492&r2=891493&view=diff
==============================================================================
--- hadoop/pig/branches/branch-0.6/CHANGES.txt (original)
+++ hadoop/pig/branches/branch-0.6/CHANGES.txt Thu Dec 17 00:13:07 2009
@@ -239,6 +239,8 @@
 
 PIG-1142: Got NullPointerException merge join with pruning (daijy)
 
+PIG-1155: Need to make sure existing loaders work "as is" (daijy)
+
 Release 0.5.0
 
 INCOMPATIBLE CHANGES

Modified: 
hadoop/pig/branches/branch-0.6/src/org/apache/pig/impl/logicalLayer/LOLoad.java
URL: 
http://svn.apache.org/viewvc/hadoop/pig/branches/branch-0.6/src/org/apache/pig/impl/logicalLayer/LOLoad.java?rev=891493&r1=891492&r2=891493&view=diff
==============================================================================
--- 
hadoop/pig/branches/branch-0.6/src/org/apache/pig/impl/logicalLayer/LOLoad.java 
(original)
+++ 
hadoop/pig/branches/branch-0.6/src/org/apache/pig/impl/logicalLayer/LOLoad.java 
Thu Dec 17 00:13:07 2009
@@ -30,6 +30,7 @@
 import org.apache.pig.ExecType;
 import org.apache.pig.LoadFunc;
 import org.apache.pig.PigException;
+import org.apache.pig.StoreFunc;
 import org.apache.pig.backend.datastorage.DataStorage;
 import org.apache.pig.data.DataType;
 import org.apache.pig.impl.PigContext;
@@ -344,7 +345,15 @@
         }
         
         this.requiredFieldList = requiredFieldList;
-        response = mLoadFunc.fieldsToRead(requiredFieldList);
+        
+        try {
+            response = mLoadFunc.fieldsToRead(requiredFieldList);
+        } catch(AbstractMethodError e) {
+            // this is for backward compatibility wherein some old LoadFunc
+            // which does not implement fieldsToRead() is being
+            // used. In this case, return false response, means we cannot 
prune any columns
+            response = new LoadFunc.RequiredFieldResponse(false);
+        }
         
         if (!response.getRequiredFieldResponse())
             return response;


Reply via email to