SQOOP-3082: Sqoop import fails after TCP connection reset if split by datetime column
authorSzabolcs Vasas <vasas@apache.org>
Fri, 18 May 2018 09:32:35 +0000 (11:32 +0200)
committerSzabolcs Vasas <vasas@apache.org>
Fri, 18 May 2018 09:32:35 +0000 (11:32 +0200)
(Sergey Svynarchuk via Szabolcs Vasas)

src/java/org/apache/sqoop/mapreduce/db/SQLServerDBRecordReader.java

index 2c8a9fd..c879c70 100644 (file)
@@ -242,7 +242,7 @@ public class SQLServerDBRecordReader<T extends SqoopRecord> extends
       StringBuilder lowerClause = new StringBuilder();
       lowerClause.append(getDBConf().getInputOrderBy());
       lowerClause.append(" > ");
-      lowerClause.append(lastRecordValue.toString());
+      lowerClause.append("'" + lastRecordValue.toString() + "'");
 
       // Get the select query with the lowerClause, and split upper clause
       selectQuery = getSelectQuery(lowerClause.toString(),