lukecwik commented on code in PR #23444:
URL: https://github.com/apache/beam/pull/23444#discussion_r984987415


##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -666,7 +666,13 @@ public ReadRows 
withStatementPreparator(StatementPreparator statementPreparator)
      * It should ONLY be used if the default value throws memory errors.
      */
     public ReadRows withFetchSize(int fetchSize) {
-      checkArgument(fetchSize > 0, "fetch size must be > 0");
+      // Note that api.java.sql.Statement#setFetchSize says it only accepts 
values >= 0
+      // and that MySQL supports using Integer.MIN_VALUE as a hint to stream 
the ResultSet instead
+      // of loading it into memory. See
+      // 
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html
 for additional details.
+       checkArgument(

Review Comment:
   ```suggestion
         checkArgument(
   ```



##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -961,7 +973,13 @@ public ReadAll<ParameterT, OutputT> 
withCoder(Coder<OutputT> coder) {
      * It should ONLY be used if the default value throws memory errors.
      */
     public ReadAll<ParameterT, OutputT> withFetchSize(int fetchSize) {
-      checkArgument(fetchSize > 0, "fetch size must be >0");
+      // Note that api.java.sql.Statement#setFetchSize says it only accepts 
values >= 0
+      // and that MySQL supports using Integer.MIN_VALUE as a hint to stream 
the ResultSet instead
+      // of loading it into memory. See
+      // 
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html
 for additional details.
+       checkArgument(

Review Comment:
   ```suggestion
         checkArgument(
   ```



##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -808,7 +814,13 @@ public Read<T> withCoder(Coder<T> coder) {
      * It should ONLY be used if the default value throws memory errors.
      */
     public Read<T> withFetchSize(int fetchSize) {
-      checkArgument(fetchSize > 0, "fetch size must be > 0");
+      // Note that api.java.sql.Statement#setFetchSize says it only accepts 
values >= 0
+      // and that MySQL supports using Integer.MIN_VALUE as a hint to stream 
the ResultSet instead
+      // of loading it into memory. See
+      // 
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-implementation-notes.html
 for additional details.
+       checkArgument(

Review Comment:
   ```suggestion
         checkArgument(
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to