You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "Polber (via GitHub)" <gi...@apache.org> on 2023/10/27 17:07:01 UTC

[PR] [YAML] Add JDBC branding transforms [beam]

Polber opened a new pull request, #29171:
URL: https://github.com/apache/beam/pull/29171

   This PR adds deafult Read/Write transforms for various JDBC flavors that abstracts out driver management.
   
   ------------------------
   
   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)
   ------------------------------------------------------------------------------------------------
   [![Build python source distribution and wheels](https://github.com/apache/beam/workflows/Build%20python%20source%20distribution%20and%20wheels/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
   [![Python tests](https://github.com/apache/beam/workflows/Python%20tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Java tests](https://github.com/apache/beam/workflows/Java%20Tests/badge.svg?branch=master&event=schedule)](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
   [![Go tests](https://github.com/apache/beam/workflows/Go%20tests/badge.svg?branch=master&event=schedule)](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] [YAML] Add JDBC branding transforms [beam]

Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #29171:
URL: https://github.com/apache/beam/pull/29171#discussion_r1377943220


##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -700,9 +700,25 @@ def __init__(self, transforms, mappings, underlying_provider, defaults=None):
     for transform in transforms.keys():
       if transform not in mappings:
         raise ValueError(f'Missing transform {transform} in mappings.')
-    self._mappings = mappings
+    self._mappings = self.get_mappings_from_transform(mappings)

Review Comment:
   Done.



-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #29171:
URL: https://github.com/apache/beam/pull/29171#discussion_r1377945416


##########
sdks/java/expansion-service/build.gradle:
##########
@@ -48,6 +48,11 @@ dependencies {
   implementation library.java.vendored_grpc_1_54_0
   implementation library.java.vendored_guava_32_1_2_jre
   implementation library.java.slf4j_api
+  // Stage default drivers for JdbcIO schema transforms

Review Comment:
   That makes sense, moved.



-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on PR #29171:
URL: https://github.com/apache/beam/pull/29171#issuecomment-1783241304

   R: @robertwb 


-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on code in PR #29171:
URL: https://github.com/apache/beam/pull/29171#discussion_r1376939121


##########
sdks/java/expansion-service/build.gradle:
##########
@@ -48,6 +48,11 @@ dependencies {
   implementation library.java.vendored_grpc_1_54_0
   implementation library.java.vendored_guava_32_1_2_jre
   implementation library.java.slf4j_api
+  // Stage default drivers for JdbcIO schema transforms

Review Comment:
   This is the base class that everyone using an expansion service depends on (even if they have nothing to do with jdbc or even IOs at all). Let's add the dependency to the specific sdks:java:extensions:schemaio-expansion-service.



-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #29171:
URL: https://github.com/apache/beam/pull/29171#issuecomment-1783267159

   We're currently processing your upload.  This comment will be updated when the results are available.


-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29171:
URL: https://github.com/apache/beam/pull/29171#issuecomment-1783242932

   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] [YAML] Add JDBC branding transforms [beam]

Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb commented on code in PR #29171:
URL: https://github.com/apache/beam/pull/29171#discussion_r1376697875


##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -700,9 +700,25 @@ def __init__(self, transforms, mappings, underlying_provider, defaults=None):
     for transform in transforms.keys():
       if transform not in mappings:
         raise ValueError(f'Missing transform {transform} in mappings.')
-    self._mappings = mappings
+    self._mappings = self.get_mappings_from_transform(mappings)

Review Comment:
   Maybe call this "validate_mappings" or "expand_mappings" to make the intent more clear? 



##########
sdks/java/io/jdbc/build.gradle:
##########
@@ -33,6 +33,10 @@ dependencies {
   implementation library.java.joda_time
   implementation "org.apache.commons:commons-pool2:2.11.1"
   implementation library.java.slf4j_api
+  implementation 'org.postgresql:postgresql:42.6.0'

Review Comment:
   I'm not sure we want to add all of these to the base jdbc package--I think the intent was for the user to provide their own dependencies. 
   
   On the other hand, I can see it'd be really handy for cross-langauge users not to have to specify this. Perhaps these dependencies could be added to the expansion service instead? 



-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "Polber (via GitHub)" <gi...@apache.org>.
Polber commented on code in PR #29171:
URL: https://github.com/apache/beam/pull/29171#discussion_r1376755339


##########
sdks/java/io/jdbc/build.gradle:
##########
@@ -33,6 +33,10 @@ dependencies {
   implementation library.java.joda_time
   implementation "org.apache.commons:commons-pool2:2.11.1"
   implementation library.java.slf4j_api
+  implementation 'org.postgresql:postgresql:42.6.0'

Review Comment:
   Yeah I wasn't sure the best spot to put them, but I agree putting them in the expansion service jar makes more sense.



-- 
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] [YAML] Add JDBC branding transforms [beam]

Posted by "robertwb (via GitHub)" <gi...@apache.org>.
robertwb merged PR #29171:
URL: https://github.com/apache/beam/pull/29171


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