You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damondouglas (via GitHub)" <gi...@apache.org> on 2024/05/17 01:18:17 UTC
[PR] Refactor RowMutationInformation to use string type [beam]
damondouglas opened a new pull request, #31323:
URL: https://github.com/apache/beam/pull/31323
This PR refactors the BigQuery APIs use of the `_CHANGE_SEQUENCE_NUMBER` fixed hex string pseudo column.
------------------------
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](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://github.com/apache/beam/blob/master/CONTRIBUTING.md#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 or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas commented on code in PR #31323:
URL: https://github.com/apache/beam/pull/31323#discussion_r1604229280
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/AvroGenericRecordToStorageApiProto.java:
##########
@@ -162,6 +162,15 @@ public static TableSchema protoTableSchemaFromAvroSchema(Schema schema) {
return builder.build();
}
+ public static DynamicMessage messageFromGenericRecord(
Review Comment:
Needs code comment.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #31323:
URL: https://github.com/apache/beam/pull/31323#discussion_r1605667268
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiDynamicDestinationsBeamRow.java:
##########
@@ -86,11 +86,11 @@ public DescriptorProtos.DescriptorProto getDescriptor(boolean includeCdcColumns)
public StorageApiWritePayload toMessage(
T element, @Nullable RowMutationInformation rowMutationInformation) throws Exception {
String changeType = null;
- long changeSequenceNum = -1;
+ String changeSequenceNum = null;
Review Comment:
if `rowMutationInformation` is null (as it is in most use-cases), what change sequence value do we set in the DynamicMessage? Can we set a null value?
(Similarly for the changes in Avro and TableRow paths)
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas merged PR #31323:
URL: https://github.com/apache/beam/pull/31323
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #31323:
URL: https://github.com/apache/beam/pull/31323#discussion_r1605667268
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiDynamicDestinationsBeamRow.java:
##########
@@ -86,11 +86,11 @@ public DescriptorProtos.DescriptorProto getDescriptor(boolean includeCdcColumns)
public StorageApiWritePayload toMessage(
T element, @Nullable RowMutationInformation rowMutationInformation) throws Exception {
String changeType = null;
- long changeSequenceNum = -1;
+ String changeSequenceNum = null;
Review Comment:
if `rowMutationInformation` is null (as it is in most use-cases), what change sequence value do we set in the DynamicMessage? Can we set a null value?
(Similarly for the changes in Avro and TableRow paths)
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2119001599
> Can we add or update existing tests in [StorageApiSinkRowUpdateIT](https://github.com/apache/beam/blob/master/sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiSinkRowUpdateIT.java)? 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.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2135849114
> @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.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2135139779
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2118179232
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).
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2135068291
Reminder, please take a look at this pr: @robertwb @Abacn
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2136195746
Thank you, @ahmedabu98 . I will merge after checks pass.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "damondouglas (via GitHub)" <gi...@apache.org>.
damondouglas commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2137957859
> 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.
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on code in PR #31323:
URL: https://github.com/apache/beam/pull/31323#discussion_r1605667268
##########
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/StorageApiDynamicDestinationsBeamRow.java:
##########
@@ -86,11 +86,11 @@ public DescriptorProtos.DescriptorProto getDescriptor(boolean includeCdcColumns)
public StorageApiWritePayload toMessage(
T element, @Nullable RowMutationInformation rowMutationInformation) throws Exception {
String changeType = null;
- long changeSequenceNum = -1;
+ String changeSequenceNum = null;
Review Comment:
if `rowMutationInformation` is null (as it is in most use-cases), what change sequence value do we set in the DynamicMessage? Can we set a null value?
Same question for the similar changes in Avro and TableRow paths
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2135137253
R: @ahmedabu98
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2118495958
## [Codecov](https://app.codecov.io/gh/apache/beam/pull/31323?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) 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 [(`c061b27`)](https://app.codecov.io/gh/apache/beam/commit/c061b2776b0afcd8eedc557e5b38229502be9cd2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`8aae6f9`)](https://app.codecov.io/gh/apache/beam/pull/31323?dropdown=coverage&src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 44 commits behind head on master.
| [Files](https://app.codecov.io/gh/apache/beam/pull/31323?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...g/apache/beam/sdk/io/gcp/bigquery/RowMutation.java](https://app.codecov.io/gh/apache/beam/pull/31323?src=pr&el=tree&filepath=sdks%2Fjava%2Fio%2Fgoogle-cloud-platform%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fbeam%2Fsdk%2Fio%2Fgcp%2Fbigquery%2FRowMutation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9qYXZhL2lvL2dvb2dsZS1jbG91ZC1wbGF0Zm9ybS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvYmVhbS9zZGsvaW8vZ2NwL2JpZ3F1ZXJ5L1Jvd011dGF0aW9uLmphdmE=) | 93.33% | [0 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/beam/pull/31323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...sdk/io/gcp/bigquery/TableRowToStorageApiProto.java](https://app.codecov.io/gh/apache/beam/pull/31323?src=pr&el=tree&filepath=sdks%2Fjava%2Fio%2Fgoogle-cloud-platform%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fbeam%2Fsdk%2Fio%2Fgcp%2Fbigquery%2FTableRowToStorageApiProto.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9qYXZhL2lvL2dvb2dsZS1jbG91ZC1wbGF0Zm9ybS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvYmVhbS9zZGsvaW8vZ2NwL2JpZ3F1ZXJ5L1RhYmxlUm93VG9TdG9yYWdlQXBpUHJvdG8uamF2YQ==) | 80.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/beam/pull/31323?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #31323 +/- ##
============================================
- Coverage 71.43% 71.02% -0.42%
- Complexity 1474 2986 +1512
============================================
Files 909 1067 +158
Lines 113707 133554 +19847
Branches 1076 3241 +2165
============================================
+ Hits 81229 94852 +13623
- Misses 30453 35591 +5138
- Partials 2025 3111 +1086
```
| [Flag](https://app.codecov.io/gh/apache/beam/pull/31323/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [java](https://app.codecov.io/gh/apache/beam/pull/31323/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `68.61% <95.55%> (+0.05%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/beam/pull/31323?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
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
Re: [PR] Refactor RowMutationInformation to use string type [beam]
Posted by "ahmedabu98 (via GitHub)" <gi...@apache.org>.
ahmedabu98 commented on PR #31323:
URL: https://github.com/apache/beam/pull/31323#issuecomment-2121019656
@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.
--
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