sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1301118 - /incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java
Date Thu, 15 Mar 2012 17:50:39 GMT
Author: blee
Date: Thu Mar 15 17:50:39 2012
New Revision: 1301118

URL: http://svn.apache.org/viewvc?rev=1301118&view=rev
Log:
SQOOP-448 boolean fields get nullified during postgres direct import into hive.
(fix a problem in previous patch)

Modified:
    incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java

Modified: incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java
URL: http://svn.apache.org/viewvc/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java?rev=1301118&r1=1301117&r2=1301118&view=diff
==============================================================================
--- incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java (original)
+++ incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/DirectPostgresqlManager.java Thu
Mar 15 17:50:39 2012
@@ -233,22 +233,24 @@ public class DirectPostgresqlManager
 
     sb.append("COPY ");
     String whereClause = this.options.getWhereClause();
-    if (whereClause == null || whereClause.length() > 0) {
+    if (whereClause == null || whereClause.isEmpty()) {
         whereClause = "1=1";
     }
-      // Import from a SELECT QUERY
-      sb.append("(");
-      sb.append("SELECT ");
-      if (null != cols) {
-      sb.append(getSelectListColumnsStr(cols, tableName));
-      } else {
-        sb.append("*");
-      }
-      sb.append(" FROM ");
-      sb.append(escapedTableName);
-      sb.append(" WHERE ");
-      sb.append(whereClause);
-      sb.append(")");
+
+    // Import from a SELECT QUERY
+    sb.append("(");
+    sb.append("SELECT ");
+    if (null != cols) {
+    sb.append(getSelectListColumnsStr(cols, tableName));
+    } else {
+      sb.append("*");
+    }
+    sb.append(" FROM ");
+    sb.append(escapedTableName);
+    sb.append(" WHERE ");
+    sb.append(whereClause);
+    sb.append(")");
+
     // Translate delimiter characters to '\ooo' octal representation.
     sb.append(" TO STDOUT WITH DELIMITER E'\\");
     sb.append(Integer.toString((int) this.options.getOutputFieldDelim(), 8));



Mime
View raw message