diff --git a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConnector.java b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConnector.java index 8b6ac80c6..fdc099cbf 100644 --- a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConnector.java +++ b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleConnector.java @@ -87,6 +87,10 @@ protected void setConnectorSpec(ConnectorSpecRequest request, DBConnectorPath pa sourceProperties.put(OracleSource.OracleSourceConfig.NUM_SPLITS, "1"); sourceProperties.put(OracleSource.OracleSourceConfig.FETCH_SIZE, OracleSource.OracleSourceConfig.DEFAULT_FETCH_SIZE); + sourceProperties.put(OracleConstants.DEFAULT_ROW_PREFETCH, + OracleSource.OracleSourceConfig.DEFAULT_ROW_PREFETCH_VALUE); + sourceProperties.put(OracleConstants.DEFAULT_BATCH_VALUE, + OracleSource.OracleSourceConfig.DEFAULT_BATCH_SIZE); String table = path.getTable(); if (table == null) { return; diff --git a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSource.java b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSource.java index 4dafdf95b..5dd5c33c8 100644 --- a/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSource.java +++ b/oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSource.java @@ -73,6 +73,8 @@ public static class OracleSourceConfig extends AbstractDBSpecificSourceConfig { public static final String NAME_USE_CONNECTION = "useConnection"; public static final String NAME_CONNECTION = "connection"; + public static final String DEFAULT_ROW_PREFETCH_VALUE = "40"; + public static final String DEFAULT_BATCH_SIZE = "10"; @Name(NAME_USE_CONNECTION) @Nullable @@ -88,12 +90,12 @@ public static class OracleSourceConfig extends AbstractDBSpecificSourceConfig { @Name(OracleConstants.DEFAULT_BATCH_VALUE) @Description("The default batch value that triggers an execution request.") @Nullable - public Integer defaultBatchValue; + private Integer defaultBatchValue; @Name(OracleConstants.DEFAULT_ROW_PREFETCH) @Description("The default number of rows to prefetch from the server.") @Nullable - public Integer defaultRowPrefetch; + private Integer defaultRowPrefetch; @Override public String getConnectionString() { @@ -111,9 +113,12 @@ public String getConnectionString() { @Override protected Map getDBSpecificArguments() { ImmutableMap.Builder builder = ImmutableMap.builder(); - - builder.put(OracleConstants.DEFAULT_BATCH_VALUE, String.valueOf(defaultBatchValue)); - builder.put(OracleConstants.DEFAULT_ROW_PREFETCH, String.valueOf(defaultRowPrefetch)); + if (defaultBatchValue != null) { + builder.put(OracleConstants.DEFAULT_BATCH_VALUE, String.valueOf(defaultBatchValue)); + } + if (defaultRowPrefetch != null) { + builder.put(OracleConstants.DEFAULT_ROW_PREFETCH, String.valueOf(defaultRowPrefetch)); + } return builder.build(); }