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
[FLINK-28433][connector/jdbc]Add mariadb jdbc connection validation #20193
Conversation
+1, After the change. We can use mariadb driver to connect the mysql through by setting the jdbcOptions of |
deb8d27
to
5d26bcc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bzhaoopenstack Thanks for the PR, but in order to add support for MariaDB I would also like to see a test and documentation in place.
Thanks very much for reply and suggest. I will add the test and documentation. Once I'm finish, I think I need your kind review and advice. Thank you. ;-) |
Hi @MartijnVisser, I have a question here, you said you want a test for this PR, does it mean we should add a specific UT which only verify the jdbc conncetion strings? Because I didn't find any existing UT in Flink. |
I would expect that we add MariaDB to the |
Thanks for explain more, this is a good direction/suggestion for me. |
5d26bcc
to
be1cf1e
Compare
Hi @MartijnVisser , sorry for late. Now, I will request an new review from your side, once we both think this PR is ready, I will remove the title [WIP]. ;-) |
@@ -27,7 +27,7 @@ | |||
public class MySqlDialectFactory implements JdbcDialectFactory { | |||
@Override | |||
public boolean acceptsURL(String url) { | |||
return url.startsWith("jdbc:mysql:"); | |||
return (url.startsWith("jdbc:mysql:") || url.startsWith("jdbc:mariadb:")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no need change here after we add MariaDBDialectFactory
@afedulov Do you want to have a look at this one? |
Hi all. @MartijnVisser @hadronzoo any updates on this one? Thanks |
@bzhaoopenstack Are you ready?If yes, please change the title without "WIP". |
Yeah, I'm ready for the kind suggest from @MartijnVisser and @hadronzoo . ;-) |
@bzhaoopenstack I won't be able to review this at the moment, but keep in mind that the CI is still failing for this PR. It makes sense to make sure that the CI works before the review actually starts. |
OK, thank you Martijn. I will resolve it and make it ready for review |
0bb91f2
to
3df6dd0
Compare
3df6dd0
to
6b782d7
Compare
Sorry for late update. ;-) . Let's wait the azure test result. I got pass on my local env. |
6b782d7
to
e30daa9
Compare
1. Flink Connector support the jdbc connection with Mysql series DB, such as MySQL, MariaDB, Percona and etc. But we see the doc reference[1] shows the Mariadb Connector/J 3.0 will accepts jdbc:mariadb: as the protocal in connection strings by default. So we need to apply this change in our mysql jdbc connection vailidation. Mariadb Connector/J 2.X still support both "jdbc:mysql:" and "jdbc:mariadb:". 2. Introduce MariaDB dialect implemented like Mysql. 3. Add UTs for DataTypes and a testcontainer for MariaDB in JdbcExactlyOnceSinkE2eTest. [1] https://mariadb.com/kb/en/about-mariadb-connector-j/#jdbcmysql-scheme-compatibility
e30daa9
to
ecea05c
Compare
@flinkbot run azure |
We've now moved the code from the JDBC connector to its own dedicated repository; please re-route this PR to https://github.com/apache/flink-connector-jdbc |
What is the purpose of the change
Percona and etc. But we see the doc reference[1] shows the Mariadb Connector/J 3.0 will
accepts jdbc:mariadb: as the protocal in connection strings by default. So we need to apply
this change in our mysql jdbc connection vailidation. Mariadb Connector/J 2.X still support
both "jdbc:mysql:" and "jdbc:mariadb:".
JdbcExactlyOnceSinkE2eTest.
[1] https://mariadb.com/kb/en/about-mariadb-connector-j/#jdbcmysql-scheme-compatibility
Brief change log
Verifying this change
Exec
mvn clean package -Dfast -Pskip-webui-build -pl flink-connectors/flink-connector-jdbc
Or
mvn clean package -Dfast -Pskip-webui-build -pl flink-connectors/flink-connector-jdbc -Dtest="org.apache.flink.connector.jdbc.xa.JdbcExactlyOnceSinkE2eTest"
for run all tests or a single test.Notes that all types didn't cover, and will be on going for support.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation