[ 
https://issues.apache.org/jira/browse/FLINK-6781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031904#comment-16031904
 ] 

ASF GitHub Bot commented on FLINK-6781:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4036#discussion_r119465263
  
    --- Diff: 
flink-connectors/flink-jdbc/src/test/java/org/apache/flink/api/java/io/jdbc/JDBCInputFormatTest.java
 ---
    @@ -101,6 +105,33 @@ public void testIncompleteConfiguration() throws 
IOException {
        }
     
        @Test
    +   public void defaultFetchSizeIsUsedIfNotConfiguredOtherwise() throws 
SQLException {
    +           jdbcInputFormat = JDBCInputFormat.buildJDBCInputFormat()
    +                   .setDrivername(DRIVER_CLASS)
    +                   .setDBUrl(DB_URL)
    +                   .setQuery(SELECT_ALL_BOOKS)
    +                   .setRowTypeInfo(ROW_TYPE_INFO)
    +                   .finish();
    +           jdbcInputFormat.openInputFormat();
    +           assertThat(jdbcInputFormat.getStatement().getFetchSize(), 
equalTo(1));
    +
    +   }
    +
    +   @Test
    +   public void fetchSizeCanBeConfigured() throws SQLException {
    +           final int desiredFetchSize = 10_000;
    +           jdbcInputFormat = JDBCInputFormat.buildJDBCInputFormat()
    +                   .setDrivername(DRIVER_CLASS)
    +                   .setDBUrl(DB_URL)
    +                   .setQuery(SELECT_ALL_BOOKS)
    +                   .setRowTypeInfo(ROW_TYPE_INFO)
    +                   .setFetchSize(desiredFetchSize)
    +                   .finish();
    +           jdbcInputFormat.openInputFormat();
    +           assertThat(jdbcInputFormat.getStatement().getFetchSize(), 
equalTo(desiredFetchSize));
    --- End diff --
    
    Would be good to replace these with junit assertEquals, to be consistent 
with the remaining tests in flink.


> Make fetch size configurable in JDBCInputFormat
> -----------------------------------------------
>
>                 Key: FLINK-6781
>                 URL: https://issues.apache.org/jira/browse/FLINK-6781
>             Project: Flink
>          Issue Type: Improvement
>          Components: Batch Connectors and Input/Output Formats
>    Affects Versions: 1.2.1
>            Reporter: Maximilian Bode
>            Assignee: Maximilian Bode
>            Priority: Minor
>
> For batch jobs that read from large tables, it is useful to be able to 
> configure the SQL statement's fetch size. In particular, for Oracle's JDBC 
> driver the default fetch size is 10.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to