sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject git commit: SQOOP-1617: MySQL fetch-size behavior changed with SQOOP-1400
Date Wed, 05 Nov 2014 22:17:53 GMT
Repository: sqoop
Updated Branches:
  refs/heads/trunk 94ade1d8c -> 2de5c850e


SQOOP-1617: MySQL fetch-size behavior changed with SQOOP-1400

(Jarek Jarcec Cecho via Abraham Elmahrek)


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

Branch: refs/heads/trunk
Commit: 2de5c850ec4a3ce07ccdfe932ceac7171af7351a
Parents: 94ade1d
Author: Abraham Elmahrek <abraham@elmahrek.com>
Authored: Wed Nov 5 14:04:40 2014 -0800
Committer: Abraham Elmahrek <abraham@elmahrek.com>
Committed: Wed Nov 5 14:04:40 2014 -0800

----------------------------------------------------------------------
 src/java/org/apache/sqoop/manager/MySQLManager.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/2de5c850/src/java/org/apache/sqoop/manager/MySQLManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/manager/MySQLManager.java b/src/java/org/apache/sqoop/manager/MySQLManager.java
index b9c9d36..e1d5a36 100644
--- a/src/java/org/apache/sqoop/manager/MySQLManager.java
+++ b/src/java/org/apache/sqoop/manager/MySQLManager.java
@@ -64,6 +64,22 @@ public class MySQLManager
   }
 
   @Override
+  protected void initOptionDefaults() {
+    if (options.getFetchSize() == null) {
+      LOG.info("Preparing to use a MySQL streaming resultset.");
+      options.setFetchSize(Integer.MIN_VALUE);
+    } else if (
+        !options.getFetchSize().equals(Integer.MIN_VALUE)
+        && !options.getFetchSize().equals(0)) {
+      LOG.info("Argument '--fetch-size " + options.getFetchSize()
+          + "' will probably get ignored by MySQL JDBC driver.");
+      // see also
+      // http://dev.mysql.com/doc/refman/5.5/en
+      //                       /connector-j-reference-implementation-notes.html
+    }
+  }
+
+  @Override
   protected String getPrimaryKeyQuery(String tableName) {
     return "SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS "
          + "WHERE TABLE_SCHEMA = (" + getSchemaQuery() + ") "


Mime
View raw message