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

Add pre_execution_queries parameter to run setup queries before main query on Postgres and MySQL source #729

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jsjasonseba
Copy link

This PR attempts to solve: #728
Also related issues: #645 #471 #656 #512

This PR adds pre_execution_queries parameter to run setup queries before main query. SET statements are typically applied on session/connection scope, so the pre-execution queries must be applied to each connection on each partition. This is implemented by running the pre-execution queries using a connection before assigning the connection to SourcePartition. This will allow all queries run by each connection on each partition to have the necessary settings.

Currently implemented in Postgres and MySQL sources.

I am quite new with rust and I noticed this change is quite breaking to the rust API since rust does not support default args. Please let me know if there is a better way to do this.

@jsjasonseba
Copy link
Author

Hi @wangxiaoying, I have fixed the tests and applied formatting. Apologies for missing them earlier. Could you please rerun the workflow?

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

Successfully merging this pull request may close these issues.

1 participant