You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by da...@apache.org on 2011/02/11 03:30:51 UTC

svn commit: r1069665 - /pig/trunk/src/org/apache/pig/builtin/BinStorage.java

Author: daijy
Date: Fri Feb 11 02:30:50 2011
New Revision: 1069665

URL: http://svn.apache.org/viewvc?rev=1069665&view=rev
Log:
Minor change: change error message for BinStorage to a more meaningful one

Modified:
    pig/trunk/src/org/apache/pig/builtin/BinStorage.java

Modified: pig/trunk/src/org/apache/pig/builtin/BinStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/builtin/BinStorage.java?rev=1069665&r1=1069664&r2=1069665&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/builtin/BinStorage.java (original)
+++ pig/trunk/src/org/apache/pig/builtin/BinStorage.java Fri Feb 11 02:30:50 2011
@@ -75,46 +75,47 @@ implements StoreFuncInterface, LoadMetad
 
     static class UnImplementedLoadCaster implements LoadCaster {
 
+        private static final String unImplementedErrorMessage = "Cannot cast bytes loaded from BinStorage. Please provide a custom converter.";
         @Override
         public DataBag bytesToBag(byte[] b, ResourceFieldSchema fieldSchema)
                 throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public String bytesToCharArray(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Double bytesToDouble(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Float bytesToFloat(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Integer bytesToInteger(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Long bytesToLong(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Map<String, Object> bytesToMap(byte[] b) throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
 
         @Override
         public Tuple bytesToTuple(byte[] b, ResourceFieldSchema fieldSchema)
                 throws IOException {
-            throw new ExecException("Cannot convert bytes load from BinStorage", 1118);
+            throw new ExecException(unImplementedErrorMessage, 1118);
         }
     }