flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-7556) Fix fetch size configurable in JDBCInputFormat for MySQL Driver
Date Tue, 29 Aug 2017 17:27:00 GMT

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

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

GitHub user nycholas opened a pull request:

    https://github.com/apache/flink/pull/4617

    [FLINK-7556] Fix fetch size configurable in JDBCInputFormat for MySQL Driver

    According to the MySQL documentation[1], it follows:
    
    * ResultSet
    
    > By default, ResultSets are completely retrieved and stored in memory. In most cases
this is the most efficient way to operate and, due to the design of the MySQL network protocol,
is easier to implement. If you are working with ResultSets that have a large number of rows
or large values and cannot allocate heap space in your JVM for the memory required, you can
tell the driver to stream the results back one row at a time.
    
    > To enable this functionality, create a Statement instance in the following manner:
    
    ```
    stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
                  java.sql.ResultSet.CONCUR_READ_ONLY);
    stmt.setFetchSize(Integer.MIN_VALUE);
    
    ```
    
    > The combination of a forward-only, read-only result set, with a fetch size of Integer.MIN_VALUE
serves as a signal to the driver to stream result sets row-by-row. After this, any result
sets created with the statement will be retrieved row-by-row.
    
    
    Allow the Integer.MIN_VALUE to be accepted as a parameter for setFetchSize.
    
    [1] - https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-implementation-notes.html

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/cenobites/flink master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/4617.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4617
    
----
commit 82535fd09cf52cb3e1c3da162dc807d7d889ac19
Author: Nycholas de Oliveira e Oliveira <nycholas@gmail.com>
Date:   2017-08-29T17:21:03Z

    [FLINK-7556] Fix fetch size configurable in JDBCInputFormat for MySQL Driver

----


> Fix fetch size configurable in JDBCInputFormat for MySQL Driver
> ---------------------------------------------------------------
>
>                 Key: FLINK-7556
>                 URL: https://issues.apache.org/jira/browse/FLINK-7556
>             Project: Flink
>          Issue Type: Bug
>          Components: Batch Connectors and Input/Output Formats
>    Affects Versions: 1.3.2
>            Reporter: Nycholas de Oliveira e Oliveira
>            Priority: Trivial
>
> According to the MySQL documentation[1], it follows:
> * ResultSet
> {quote}By default, ResultSets are completely retrieved and stored in memory. In most
cases this is the most efficient way to operate and, due to the design of the MySQL network
protocol, is easier to implement. If you are working with ResultSets that have a large number
of rows or large values and cannot allocate heap space in your JVM for the memory required,
you can tell the driver to stream the results back one row at a time.
> {quote}
> {quote}To enable this functionality, create a Statement instance in the following manner:{quote}
> {code:java}
> stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
>               java.sql.ResultSet.CONCUR_READ_ONLY);
> stmt.setFetchSize(Integer.MIN_VALUE);
> {code}
> {quote}The combination of a forward-only, read-only result set, with a fetch size of
Integer.MIN_VALUE serves as a signal to the driver to stream result sets row-by-row. After
this, any result sets created with the statement will be retrieved row-by-row.{quote}
> Allow the *Integer.MIN_VALUE* to be accepted as a parameter for _setFetchSize_.
> [1] - https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-implementation-notes.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message