beam icon indicating copy to clipboard operation
beam copied to clipboard

Refactor RowMutationInformation to use string type

Open damondouglas opened this issue 1 year ago • 4 comments

This PR closes #31335 via refactoring BigQueryIO's assignment of the _CHANGE_SEQUENCE_NUMBER pseudo column from a long to fixed hex string.

All BigQuery related tests for ./gradlew :sdks:java:io:google-cloud-platform:postCommit and ./gradlew :sdks:java:io:google-cloud-platform:build passed on my local machine.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [x] 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.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels Python tests Java tests Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

damondouglas avatar May 17 '24 01:05 damondouglas

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @robertwb for label java. R: @Abacn for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

github-actions[bot] avatar May 17 '24 18:05 github-actions[bot]

Codecov Report

Attention: Patch coverage is 95.55556% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 71.02%. Comparing base (93cc6a5) to head (8aae6f9). Report is 4 commits behind head on master.

:exclamation: Current head 8aae6f9 differs from pull request most recent head 31a91fd

Please upload reports for the commit 31a91fd to get more accurate results.

Files Patch % Lines
...g/apache/beam/sdk/io/gcp/bigquery/RowMutation.java 93.33% 0 Missing and 1 partial :warning:
...sdk/io/gcp/bigquery/TableRowToStorageApiProto.java 80.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #31323      +/-   ##
============================================
+ Coverage     68.55%   71.02%   +2.47%     
+ Complexity    14921     2986   -11935     
============================================
  Files          2636     1067    -1569     
  Lines        222073   133554   -88519     
  Branches      11825     3241    -8584     
============================================
- Hits         152234    94852   -57382     
+ Misses        63644    35591   -28053     
+ Partials       6195     3111    -3084     
Flag Coverage Δ
java 68.61% <95.55%> (+2.89%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 17 '24 23:05 codecov[bot]

Can we add or update existing tests in StorageApiSinkRowUpdateIT? That class contains integration tests for RowMutationInformation. Would be good to have some real end-to-end tests to check this new behavior

@ahmedabu98 that test already covers the refactor behavior. For example, there's a call to RowMutationInformation.of using a long value. This is forwarded to the RowMutationInformation.of that takes the string parameter set using Long.toHexString. Adding additional tests using the string parameter directly would just test implementation details.

damondouglas avatar May 18 '24 20:05 damondouglas

@damondouglas Sorry I mean the new behavior of having multiple sections in the CSN (e.g. a\b\c\d). I don't think that's covered in our integration tests.

ahmedabu98 avatar May 20 '24 18:05 ahmedabu98

Reminder, please take a look at this pr: @robertwb @Abacn

github-actions[bot] avatar May 28 '24 12:05 github-actions[bot]

R: @ahmedabu98

Abacn avatar May 28 '24 12:05 Abacn

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

github-actions[bot] avatar May 28 '24 12:05 github-actions[bot]

@damondouglas Sorry I mean the new behavior of having multiple sections in the CSN (e.g. a\b\c\d). I don't think that's covered in our integration tests.

@ahmedabu98 I added the test cases but to keep things simple used AAA/<n> where n was the original long.

damondouglas avatar May 28 '24 18:05 damondouglas

Thank you, @ahmedabu98 . I will merge after checks pass.

damondouglas avatar May 28 '24 22:05 damondouglas

Thank you, @ahmedabu98 . I will merge after checks pass.

FYI failing checks have nothing to do with code in the PR. Ran additional internal tests (see internal chat) and passed.

damondouglas avatar May 29 '24 17:05 damondouglas