pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1728262 - in /pig/trunk: ./ contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/ src/org/apache/pig/backend/hadoop/hbase/ src/org/apache/pig/impl/logicalLayer/schema/ src/org/apache/pig/newplan/logical/visitor/
Date Wed, 03 Feb 2016 07:34:57 GMT
Author: daijy
Date: Wed Feb  3 07:34:56 2016
New Revision: 1728262

URL: http://svn.apache.org/viewvc?rev=1728262&view=rev
Log:
PIG-4761: Add more information to front end error messages

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/LoadFuncHelper.java
    pig/trunk/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java
    pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java
    pig/trunk/src/org/apache/pig/newplan/logical/visitor/TypeCheckingRelVisitor.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1728262&r1=1728261&r2=1728262&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Wed Feb  3 07:34:56 2016
@@ -24,6 +24,8 @@ INCOMPATIBLE CHANGES
 
 IMPROVEMENTS
 
+PIG-4761: Add more information to front end error messages (eyal via daijy)
+
 PIG-4792: Do not add java and sun system properties to jobconf (rohini)
 
 PIG-4787: Log JSONLoader exception while parsing records (rohini)

Modified: pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/LoadFuncHelper.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/LoadFuncHelper.java?rev=1728262&r1=1728261&r2=1728262&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/LoadFuncHelper.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/allloader/LoadFuncHelper.java
Wed Feb  3 07:34:56 2016
@@ -162,7 +162,7 @@ public class LoadFuncHelper {
             path = getFirstFile(fileSystem, path);
 
             if (path == null) {
-                throw new FrontendException(path + " has no files");
+                throw new FrontendException(location + " has no files");
             }
         }
 

Modified: pig/trunk/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java?rev=1728262&r1=1728261&r2=1728262&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java (original)
+++ pig/trunk/src/org/apache/pig/backend/hadoop/hbase/HBaseStorage.java Wed Feb  3 07:34:56
2016
@@ -1189,7 +1189,7 @@ public class HBaseStorage extends LoadFu
         this.requiredFieldList = requiredFieldList;
 
         if (requiredFieldList != null && requiredFields.size() > (columnInfo_.size()
+ colOffset)) {
-            throw new FrontendException("The list of columns to project from HBase is larger
than HBaseStorage is configured to load.");
+            throw new FrontendException("The list of columns to project from HBase (" + requiredFields.size()
+ ") is larger than HBaseStorage is configured to load (" + (columnInfo_.size() + colOffset)
+ ").");
         }
 
         // remember the projection

Modified: pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java?rev=1728262&r1=1728261&r2=1728262&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java (original)
+++ pig/trunk/src/org/apache/pig/impl/logicalLayer/schema/SchemaUtil.java Wed Feb  3 07:34:56
2016
@@ -263,7 +263,7 @@ public class SchemaUtil {
                 throw new FrontendException(
                         "Currently pig do not support this kind of type using Schema:"
                                 + DataType.findTypeName(type)
-                                + ". You can write shema by yourself.");
+                                + ". You can write schema by yourself.");
             }
         }
 
@@ -271,11 +271,10 @@ public class SchemaUtil {
 
     private static void checkParameters(List<String> names, List<Byte> dataTypes)
             throws FrontendException {
-        // TODO Auto-generated method stub
         checkDataTypes(dataTypes);
         if (names.size() != dataTypes.size()) {
             throw new FrontendException(
-                    "The number of names is not equal to the number of dataTypes");
+                    "The number of names (" + names.size() + ") is not equal to the number
of dataTypes (" + dataTypes.size() + ")");
         }
     }
 

Modified: pig/trunk/src/org/apache/pig/newplan/logical/visitor/TypeCheckingRelVisitor.java
URL: http://svn.apache.org/viewvc/pig/trunk/src/org/apache/pig/newplan/logical/visitor/TypeCheckingRelVisitor.java?rev=1728262&r1=1728261&r2=1728262&view=diff
==============================================================================
--- pig/trunk/src/org/apache/pig/newplan/logical/visitor/TypeCheckingRelVisitor.java (original)
+++ pig/trunk/src/org/apache/pig/newplan/logical/visitor/TypeCheckingRelVisitor.java Wed Feb
 3 07:34:56 2016
@@ -767,12 +767,14 @@ public class TypeCheckingRelVisitor exte
                 throw new FrontendException(msg, errCode, PigException.INPUT, false, null)
;
             }
             byte innerType = ((LogicalExpression)innerPlans.get(0).getSources().get(0)).getType()
;
-            groupType = DataType.mergeType(groupType, innerType) ;
-            if (groupType == -1)
+            byte newGroupType = DataType.mergeType(groupType, innerType) ;
+            if (newGroupType == -1)
             {
                 int errCode = 1107;
-                String msg = "Cannot merge join keys, incompatible types";
+                String msg = "Cannot merge join keys, incompatible types. Outer: " + DataType.findTypeName(groupType)
+ "; inner: " + DataType.findTypeName(innerType);
                 throw new FrontendException(msg, errCode, PigException.INPUT) ;
+            } else {
+                groupType = newGroupType;
             }
         }
 
@@ -806,12 +808,14 @@ public class TypeCheckingRelVisitor exte
                 throw new FrontendException(msg, errCode, PigException.INPUT, false, null)
;
             }
             byte innerType = ((LogicalExpression)innerPlans.get(0).getSources().get(0)).getType()
;
-            groupType = DataType.mergeType(groupType, innerType) ;
-            if (groupType == -1)
+            byte newGroupType = DataType.mergeType(groupType, innerType) ;
+            if (newGroupType == -1)
             {
                 int errCode = 1107;
-                String msg = "Cannot merge join keys, incompatible types";
+                String msg = "Cannot merge join keys, incompatible types. Outer: " + DataType.findTypeName(groupType)
+ "; inner: " + DataType.findTypeName(innerType);
                 throw new FrontendException(msg, errCode, PigException.INPUT) ;
+            } else {
+                groupType = newGroupType;
             }
         }
 



Mime
View raw message