src/main/java/org/embulk/input/MySQLInputPlugin.java in embulk-input-mysql-0.2.1 vs src/main/java/org/embulk/input/MySQLInputPlugin.java in embulk-input-mysql-0.2.2
- old
+ new
@@ -4,10 +4,11 @@
import java.sql.Connection;
import java.sql.Driver;
import java.sql.SQLException;
import com.google.common.base.Throwables;
import org.embulk.config.Config;
+import org.embulk.config.ConfigDefault;
import org.embulk.input.jdbc.AbstractJdbcInputPlugin;
import org.embulk.input.mysql.MySQLInputConnection;
public class MySQLInputPlugin
extends AbstractJdbcInputPlugin
@@ -50,9 +51,18 @@
// props.setProperty("useSSL", "true");
// props.setProperty("requireSSL", "true");
// props.setProperty("verifyServerCertificate", "true");
// break;
//}
+
+ if (task.getFetchRows() == 1) {
+ logger.info("Fetch size is 1. Fetching rows one by one.");
+ } else if (task.getFetchRows() <= 0) {
+ logger.info("Fetch size is set to -1. Fetching all rows at once.");
+ } else {
+ logger.info("Fetch size is {}. Using server-side prepared statement.", task.getFetchRows());
+ props.setProperty("useCursorFetch", "true");
+ }
props.putAll(task.getOptions());
Driver driver;
try {