Author: daijy Date: Thu Dec 17 00:09:09 2009 New Revision: 891492 URL: http://svn.apache.org/viewvc?rev=891492&view=rev Log: PIG-1155: Need to make sure existing loaders work 'as is'
Modified: hadoop/pig/trunk/CHANGES.txt hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLoad.java Modified: hadoop/pig/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/pig/trunk/CHANGES.txt?rev=891492&r1=891491&r2=891492&view=diff ============================================================================== --- hadoop/pig/trunk/CHANGES.txt (original) +++ hadoop/pig/trunk/CHANGES.txt Thu Dec 17 00:09:09 2009 @@ -285,6 +285,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/trunk/src/org/apache/pig/impl/logicalLayer/LOLoad.java URL: http://svn.apache.org/viewvc/hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLoad.java?rev=891492&r1=891491&r2=891492&view=diff ============================================================================== --- hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLoad.java (original) +++ hadoop/pig/trunk/src/org/apache/pig/impl/logicalLayer/LOLoad.java Thu Dec 17 00:09:09 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;