Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RowMutationInformation to use string type #31323

Merged
merged 5 commits into from
May 29, 2024

Conversation

damondouglas
Copy link
Contributor

@damondouglas damondouglas commented May 17, 2024

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:

  • 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 damondouglas marked this pull request as ready for review May 17, 2024 18:32
Copy link
Contributor

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).

Copy link

codecov bot commented May 17, 2024

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.

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 ⚠️
...sdk/io/gcp/bigquery/TableRowToStorageApiProto.java 80.00% 1 Missing ⚠️
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%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@damondouglas
Copy link
Contributor Author

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.

@ahmedabu98
Copy link
Contributor

@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.

Copy link
Contributor

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

@Abacn
Copy link
Contributor

Abacn commented May 28, 2024

R: @ahmedabu98

Copy link
Contributor

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

@damondouglas
Copy link
Contributor Author

@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.

Copy link
Contributor

@ahmedabu98 ahmedabu98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the tests! this LGTM

@damondouglas
Copy link
Contributor Author

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

@damondouglas damondouglas merged commit df8bead into apache:master May 29, 2024
16 of 18 checks passed
@damondouglas damondouglas deleted the bq_cdc_sequence_number branch May 29, 2024 17:49
@damondouglas
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Enable BigQueryIO to support _CHANGE_SEQUENCE_NUMBER fixed hex string pseudo column
4 participants