Skip to content

Conversation

@claudevdm
Copy link
Collaborator

@claudevdm claudevdm commented Jun 22, 2025

This PR adds a MySQL vector writer implementation following the same pattern as Postgres vector writer.

  • sdks/python/apache_beam/ml/rag/ingestion/mysql.py contains the base MySQL vector writer logic that can be used for any MySQL instance
  • sdks/python/apache_beam/ml/rag/ingestion/mysql_common.py contains MySQL dialect utilities for configuring the vector writer, including ColumnSpecs for specifying how Chunk should be mapped to a MySQL schema and ConflictResolution for how inserts that violate uniqueness constraints should be handled
  • sdks/python/apache_beam/ml/rag/ingestion/cloudsql.py is a wrapper around the base MySQL vector writer that allows connecting to a CloudSQL instance via the cloudsql socket factory
  • sdks/python/apache_beam/ml/rag/ingestion/cloudsql_it_test.py contains tests that cover the base mysql logic. I did not add a base MySQL test to avoid having to spin up mysql database containers and bloating the test infrastructure.

I tried to strike a balance between maintainability of cloudsql specific dialects by not mixing postgres and mysql language utilities while sharing jdbc common utilities and cloudsql common utilities that do not change depending on the dialect.


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.

@claudevdm
Copy link
Collaborator Author

R: @damccorm

Sorry for the long PR. I am happy to split it into multiple, maybe?

  1. Add default schema + tests
  2. Add columnspecs (non default schema) + tests
  3. Add conflict resolution + tests

@claudevdm claudevdm marked this pull request as ready for review June 27, 2025 19:16
@claudevdm claudevdm requested a review from damccorm June 27, 2025 19:17
@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

Thanks - mostly looks good (and very in line with other pieces, which is good)

@claudevdm
Copy link
Collaborator Author

Test failures are related to test containers version change

Co-authored-by: Danny McCormick <dannymccormick@google.com>
@damccorm damccorm merged commit 28fd2b2 into apache:master Jul 7, 2025
112 of 115 checks passed
@Abacn
Copy link
Contributor

Abacn commented Jul 11, 2025

This has increased the number of test of https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml?query=event%3Aschedule from 45 -> 62 causing tests often run exceeds 3h timeout

@claudevdm
Copy link
Collaborator Author

https://github.com/apache/beam/actions/workflows/beam_PostCommit_Python_Xlang_Gcp_Dataflow.yml?query=event%3Aschedule

@Abacn where can I see the list of tests that actually run? I set all of these new tests to be skip on dataflow runner. In the publish test section I see before this change

67 tests found
45 skipped tests found
So that means 22 tests ran?

After this change
84 tests found
62 skipped tests found
Also 22 tests ran?

@claudevdm
Copy link
Collaborator Author

Actually looking back at the test history, it was timing out a lot before this change too.

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.

3 participants