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

jjiey commented on FLINK-21820:
-------------------------------

I think this value is *Integer**.MIN_VALUE*.

Reasons as follows:

>From the [MySQL Connector/J 8.0 Developer 
>Guide|https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html]
> we know, There are two ways to tell the driver to stream the results.

The first is:
{code:java}
stmt = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY,
              java.sql.ResultSet.CONCUR_READ_ONLY);
stmt.setFetchSize(Integer.MIN_VALUE); // it must be Integer.MIN_VALUE
{code}
The second is:
{code:java}
conn = 
DriverManager.getConnection("jdbc:mysql://localhost/?useCursorFetch=true", 
"user", "s3cr3t"); // set the connection property useCursorFetch to true
stmt = conn.createStatement();
stmt.setFetchSize(100);
{code}

> JDBC connector shouldn't read all rows in per statement by default
> ------------------------------------------------------------------
>
>                 Key: FLINK-21820
>                 URL: https://issues.apache.org/jira/browse/FLINK-21820
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors / JDBC, Table SQL / Ecosystem
>            Reporter: Leonard Xu
>            Priority: Major
>
> The default value for JDBC option 'scan.fetch-size' is 0 which means read all 
> rows in statement, this may lead to OOM or IO timeout.
> We'd better set a reasonable value as default value.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to