sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: SQOOP-585: Bug when sqoop a join of two tables with the same column name with mysql backend
Date Sun, 13 Jul 2014 17:31:11 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk c3b9a87d6 -> e2d6499da


SQOOP-585: Bug when sqoop a join of two tables with the same column name with mysql backend

(Amit Sela via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/e2d6499d
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/e2d6499d
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/e2d6499d

Branch: refs/heads/trunk
Commit: e2d6499da8567888989908ddcd078f046e859679
Parents: c3b9a87
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sun Jul 13 10:30:43 2014 -0700
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sun Jul 13 10:30:43 2014 -0700

----------------------------------------------------------------------
 src/java/org/apache/sqoop/manager/SqlManager.java    | 12 ++++++------
 src/java/org/apache/sqoop/util/ResultSetPrinter.java |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2d6499d/src/java/org/apache/sqoop/manager/SqlManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/manager/SqlManager.java b/src/java/org/apache/sqoop/manager/SqlManager.java
index 58fea05..0bf97a5 100644
--- a/src/java/org/apache/sqoop/manager/SqlManager.java
+++ b/src/java/org/apache/sqoop/manager/SqlManager.java
@@ -142,9 +142,9 @@ public abstract class SqlManager
       ArrayList<String> columns = new ArrayList<String>();
       ResultSetMetaData metadata = results.getMetaData();
       for (int i = 1; i < cols + 1; i++) {
-        String colName = metadata.getColumnName(i);
+        String colName = metadata.getColumnLabel(i);
         if (colName == null || colName.equals("")) {
-          colName = metadata.getColumnLabel(i);
+          colName = metadata.getColumnName(i);
           if (null == colName) {
             colName = "_RESULT_" + i;
           }
@@ -261,9 +261,9 @@ public abstract class SqlManager
             typeId = Types.BIGINT;
         }
 
-        String colName = metadata.getColumnName(i);
+        String colName = metadata.getColumnLabel(i);
         if (colName == null || colName.equals("")) {
-          colName = metadata.getColumnLabel(i);
+          colName = metadata.getColumnName(i);
         }
 
         colTypes.put(colName, Integer.valueOf(typeId));
@@ -319,9 +319,9 @@ public abstract class SqlManager
       for (int i = 1; i < cols + 1; i++) {
         String colTypeName = metadata.getColumnTypeName(i);
 
-        String colName = metadata.getColumnName(i);
+        String colName = metadata.getColumnLabel(i);
         if (colName == null || colName.equals("")) {
-          colName = metadata.getColumnLabel(i);
+          colName = metadata.getColumnName(i);
         }
 
         colTypeNames.put(colName, colTypeName);

http://git-wip-us.apache.org/repos/asf/sqoop/blob/e2d6499d/src/java/org/apache/sqoop/util/ResultSetPrinter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/util/ResultSetPrinter.java b/src/java/org/apache/sqoop/util/ResultSetPrinter.java
index 72c98ca..3f60ea9 100644
--- a/src/java/org/apache/sqoop/util/ResultSetPrinter.java
+++ b/src/java/org/apache/sqoop/util/ResultSetPrinter.java
@@ -73,11 +73,11 @@ public class ResultSetPrinter {
       ResultSetMetaData metadata = results.getMetaData();
       sbNames.append(LEFT_BORDER);
       for (int i = 1; i < cols + 1; i++) {
-        String colName = metadata.getColumnName(i);
+        String colName = metadata.getColumnLabel(i);
         colWidths[i - 1] = Math.min(metadata.getColumnDisplaySize(i),
             MAX_COL_WIDTH);
         if (colName == null || colName.equals("")) {
-          colName = metadata.getColumnLabel(i) + "*";
+          colName = metadata.getColumnName(i) + "*";
         }
         printPadded(sbNames, colName, colWidths[i - 1]);
         sbNames.append(COL_SEPARATOR);


Mime
View raw message