sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From annaszo...@apache.org
Subject sqoop git commit: SQOOP-3194: HCatalogExportTest fails because of column escaping problems
Date Tue, 20 Jun 2017 10:17:44 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 66ce74a91 -> af277ae3e


SQOOP-3194: HCatalogExportTest fails because of column escaping problems

(Szabolcs Vasas via Anna Szonyi)


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

Branch: refs/heads/trunk
Commit: af277ae3e723e672b97513601c23754c76cbb09f
Parents: 66ce74a
Author: Anna Szonyi <annaszonyi@apache.org>
Authored: Tue Jun 20 12:14:25 2017 +0200
Committer: Anna Szonyi <annaszonyi@apache.org>
Committed: Tue Jun 20 12:14:25 2017 +0200

----------------------------------------------------------------------
 src/test/org/apache/sqoop/hcat/HCatalogExportTest.java | 8 ++++----
 src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/af277ae3/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java
----------------------------------------------------------------------
diff --git a/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java b/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java
index 32add56..7ff046e 100644
--- a/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java
+++ b/src/test/org/apache/sqoop/hcat/HCatalogExportTest.java
@@ -113,8 +113,8 @@ public class HCatalogExportTest extends ExportJobTestCase {
     Object expectedMin = generator.getDBValue(minId);
     Object expectedMax = generator.getDBValue(maxId);
 
-    utils.assertSqlColValForRowId(conn, table, minId, colName, true, expectedMin);
-    utils.assertSqlColValForRowId(conn, table, maxId, colName, true, expectedMax);
+    utils.assertSqlColValForRowId(conn, table, minId, colName, false, expectedMin);
+    utils.assertSqlColValForRowId(conn, table, maxId, colName, false, expectedMax);
   }
 
   protected void runHCatExport(List<String> addlArgsArray,
@@ -122,7 +122,7 @@ public class HCatalogExportTest extends ExportJobTestCase {
     ColumnGenerator[] cols) throws Exception {
     utils.createHCatTable(CreateMode.CREATE_AND_LOAD,
       totalRecords, table, cols);
-    utils.createSqlTable(getConnection(), true, totalRecords, table, true, cols);
+    utils.createSqlTable(getConnection(), true, totalRecords, table, false, cols);
     Map<String, String> addlArgsMap = utils.getAddlTestArgs();
     addlArgsArray.add("--verbose");
     addlArgsArray.add("-m");
@@ -338,7 +338,7 @@ public class HCatalogExportTest extends ExportJobTestCase {
     };
     List<String> addlArgsArray = new ArrayList<String>();
     addlArgsArray.add("--columns");
-    addlArgsArray.add("id,msg");
+    addlArgsArray.add("ID,MSG");
     runHCatExport(addlArgsArray, TOTAL_RECORDS, table, cols);
 
   }

http://git-wip-us.apache.org/repos/asf/sqoop/blob/af277ae3/src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java
----------------------------------------------------------------------
diff --git a/src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java b/src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java
index 4301a33..6fb6486 100644
--- a/src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java
+++ b/src/test/org/apache/sqoop/hcat/HCatalogTestUtils.java
@@ -577,7 +577,7 @@ public final class HCatalogTestUtils {
     LOG.info("Verifying column " + colName + " has value " + expectedVal);
     String escapeStr = escapeId? "\"" : "";
     PreparedStatement statement = conn.prepareStatement(
-      "SELECT "+escapeStr + colName + escapeStr+" FROM " + table + " WHERE "+escapeStr+"id"+escapeStr+"
= " + id,
+      "SELECT \"" + colName +"\" FROM " + table + " WHERE "+escapeStr+"id"+escapeStr+" =
" + id,
       ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
     Object actualVal = null;
     try {


Mime
View raw message