You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/30 12:26:39 UTC
[GitHub] [beam] mcGIh opened a new pull request, #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
mcGIh opened a new pull request, #23444:
URL: https://github.com/apache/beam/pull/23444
Addresses #23441
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] [**Choose reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and mention them in a comment (`R: @username`).
- [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://beam.apache.org/contribute/get-started-contributing/#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik commented on a diff in pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik merged pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
lukecwik merged PR #23444:
URL: https://github.com/apache/beam/pull/23444
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] mcGIh commented on pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
mcGIh commented on PR #23444:
URL: https://github.com/apache/beam/pull/23444#issuecomment-1263579207
R: @jbonofre
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik commented on a diff in pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
lukecwik commented on code in PR #23444:
URL: https://github.com/apache/beam/pull/23444#discussion_r984983025
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -666,7 +666,9 @@ 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");
+ checkArgument(
Review Comment:
```suggestion
// Note that api.java.sql.Statement#setFetchSize says it only accepts values greater than >= 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(
```
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -961,7 +965,9 @@ 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");
+ checkArgument(
Review Comment:
```suggestion
// Note that api.java.sql.Statement#setFetchSize says it only accepts values greater than >= 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(
```
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -808,7 +810,9 @@ 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");
+ checkArgument(
Review Comment:
```suggestion
// Note that api.java.sql.Statement#setFetchSize says it only accepts values greater than >= 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(
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] github-actions[bot] commented on pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #23444:
URL: https://github.com/apache/beam/pull/23444#issuecomment-1263580597
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik commented on pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
lukecwik commented on PR #23444:
URL: https://github.com/apache/beam/pull/23444#issuecomment-1264090896
@mcGIh can you run `./gradlew spotlessApply` to fix the formatting for the comment that I added and push that up as a change?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik commented on pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
lukecwik commented on PR #23444:
URL: https://github.com/apache/beam/pull/23444#issuecomment-1264242511
Run Java PreCommit
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [beam] lukecwik commented on a diff in pull request #23444: JdbcIO fetchSize can be set to Integer.MIN_VALUE
Posted by GitBox <gi...@apache.org>.
lukecwik commented on code in PR #23444:
URL: https://github.com/apache/beam/pull/23444#discussion_r984986855
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -666,7 +666,10 @@ 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 greater than >= 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(
+ fetchSize > 0 || fetchSize == Integer.MIN_VALUE,
+ "fetch size must be > 0 or equal to Integer.MIN_VALUE");
Review Comment:
```suggestion
// 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(
fetchSize >= 0 || fetchSize == Integer.MIN_VALUE,
"fetch size must be >= 0 or equal to Integer.MIN_VALUE");
```
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -808,7 +811,10 @@ 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 greater than >= 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(
+ fetchSize > 0 || fetchSize == Integer.MIN_VALUE,
+ "fetch size must be > 0 or equal to Integer.MIN_VALUE");
Review Comment:
```suggestion
// 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(
fetchSize >= 0 || fetchSize == Integer.MIN_VALUE,
"fetch size must be >= 0 or equal to Integer.MIN_VALUE");
```
##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -961,7 +967,10 @@ 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 greater than >= 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(
+ fetchSize > 0 || fetchSize == Integer.MIN_VALUE,
+ "fetch size must be > 0 or equal to Integer.MIN_VALUE");
Review Comment:
```suggestion
// 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(
fetchSize >= 0 || fetchSize == Integer.MIN_VALUE,
"fetch size must be >= 0 or equal to Integer.MIN_VALUE");
```
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org