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

[Go SDK]: Infer field names from struct tags #24473

Merged

Conversation

johannaojeling
Copy link
Contributor

Implements a function structx.InferFieldNames which takes a struct type and a tag key, and returns a slice of field names based on this. Fixes #24465.

Updates bigqueryio.Read and spannerio.Read to make use of structx.InferFieldNames when constructing select statements.


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

  • Choose reviewer(s) 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.

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.

@codecov
Copy link

codecov bot commented Dec 1, 2022

Codecov Report

Merging #24473 (7d3d0a9) into master (ec2a07b) will increase coverage by 0.00%.
The diff coverage is 88.23%.

@@           Coverage Diff           @@
##           master   #24473   +/-   ##
=======================================
  Coverage   73.36%   73.37%           
=======================================
  Files         718      719    +1     
  Lines       97165    97185   +20     
=======================================
+ Hits        71287    71310   +23     
+ Misses      24531    24528    -3     
  Partials     1347     1347           
Flag Coverage Δ
go 51.64% <88.23%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
sdks/go/pkg/beam/io/spannerio/spanner.go 50.94% <0.00%> (-1.65%) ⬇️
sdks/go/pkg/beam/io/bigqueryio/bigquery.go 9.89% <72.72%> (+4.14%) ⬆️
sdks/go/pkg/beam/util/structx/struct.go 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@johannaojeling
Copy link
Contributor Author

R: @lostluck

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

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

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for clearing out that TODO!

Please note that neither of those two IOs are currently incredibly performant. They work, but they are unable to scale to multiple machines presently. I go into why a bit in a recent reply: #24364 (comment)

@lostluck
Copy link
Contributor

lostluck commented Dec 1, 2022

Run Go PostCommit

@johannaojeling
Copy link
Contributor Author

LGTM. Thank you for clearing out that TODO!

Please note that neither of those two IOs are currently incredibly performant. They work, but they are unable to scale to multiple machines presently. I go into why a bit in a recent reply: #24364 (comment)

Thanks for the reference! I was thinking of developing a new IO connector and will bear it in mind

@lostluck lostluck merged commit e1cd5c4 into apache:master Dec 2, 2022
@johannaojeling johannaojeling deleted the task/24465-fields-from-struct branch December 7, 2022 06:56
lostluck pushed a commit to lostluck/beam that referenced this pull request Dec 22, 2022
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.

[Task][Go SDK]: Utility function for inferring field names based on struct tags
2 participants