sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arv...@apache.org
Subject svn commit: r1165969 - /incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java
Date Wed, 07 Sep 2011 02:46:13 GMT
Author: arvind
Date: Wed Sep  7 02:46:12 2011
New Revision: 1165969

URL: http://svn.apache.org/viewvc?rev=1165969&view=rev
Log:
SQOOP-330. Descriptive error message when column name cannot be determined.

(Jarek Jarcec Cecho via Arvind Prabhakar)

Modified:
    incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java

Modified: incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java?rev=1165969&r1=1165968&r2=1165969&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java (original)
+++ incubator/sqoop/trunk/src/java/com/cloudera/sqoop/orm/ClassWriter.java Wed Sep  7 02:46:12
2011
@@ -21,7 +21,6 @@ package com.cloudera.sqoop.orm;
 import org.apache.hadoop.io.BytesWritable;
 import com.cloudera.sqoop.SqoopOptions;
 import com.cloudera.sqoop.manager.ConnManager;
-import com.cloudera.sqoop.manager.SqlManager;
 import com.cloudera.sqoop.lib.BigDecimalSerializer;
 import com.cloudera.sqoop.lib.BooleanParser;
 import com.cloudera.sqoop.lib.DelimiterSet;
@@ -1041,8 +1040,17 @@ public class ClassWriter {
     String [] cleanedColNames = cleanColNames(colNames);
     Set<String> uniqColNames = new HashSet<String>();
     for (int i = 0; i < colNames.length; i++) {
-      // Guarantee uniq col identifier
       String identifier = cleanedColNames[i];
+
+      // Name can't be blank
+      if(identifier.isEmpty()) {
+        throw new IllegalArgumentException("We found column without column "
+                + "name. Please verify that you've entered all column names "
+                + "in your query if using free form query import (consider "
+                + "adding clause AS if you're using column transformation)");
+      }
+
+      // Guarantee uniq col identifier
       if (uniqColNames.contains(identifier)) {
           throw new IllegalArgumentException("Duplicate Column identifier "
               + "specified: '" + identifier + "'");



Mime
View raw message