-
Notifications
You must be signed in to change notification settings - Fork 169
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-31551] Add support for CrateDB #29
Conversation
Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html) |
This is required by https://github.com/crate/cratedb-flink-jobs until apache/flink-connector-jdbc#29 is merged.
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.
@matriv Thanks for the PR, generally it looks good, I've left some comments inlined.
Besides, I see a lot "Postgres" in your code, is that because you copied from PG dialect and forgot to change some places, or CrateDB is just very like Postgres so that you chose to keep "Postgres" in the code?
| PostgreSQL | `org.postgresql` | `postgresql` | [Download](https://jdbc.postgresql.org/download.html) | | ||
| Derby | `org.apache.derby` | `derby` | [Download](http://db.apache.org/derby/derby_downloads.html) | | ||
| SQL Server | `com.microsoft.sqlserver` | `mssql-jdbc` | [Download](https://docs.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver16) | | ||
| CrateDB | `io.crate` | `crate-jdbc` | [Download](https://repo1.maven.org/maven2/io/crate/crate-jdbc/) | |
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.
Could you also help to update the corresponding section in 'zh' doc?
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.
Also add a section in the "JDBC Catalog".
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.
Done, but this part requires translation to chinese, could you please take care of this?
...k-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/CrateDBTablePath.java
Outdated
Show resolved
Hide resolved
...k-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/CrateDBTablePath.java
Outdated
Show resolved
Hide resolved
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/CrateDBCatalog.java
Outdated
Show resolved
Hide resolved
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/CrateDBCatalog.java
Outdated
Show resolved
Hide resolved
...ector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/cratedb/CrateDBDialect.java
Outdated
Show resolved
Hide resolved
...nnector-jdbc/src/test/java/org/apache/flink/connector/jdbc/catalog/CrateDBTablePathTest.java
Outdated
Show resolved
Hide resolved
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.
@matriv its seems that 80% of classes are the same from Postgres.. Could make sense to create a abstraction with common code and both extends this new abstraction?
flink-connector-jdbc/archunit-violations/6b9ab1b0-c14d-4667-bab5-407b81fba98b
Outdated
Show resolved
Hide resolved
Thx a lot both of you for the review. @eskabetxe True, CrateDB is very similar in connectivity with PostgreSQL and some things could be even simpler in this PR if we implement a change to support this: https://issues.apache.org/jira/browse/FLINK-31553, because then we wouldn't even need the CrateDB fork of the JDBC , and the Definitely I will try to avoid duplication and use more from the PostgreSQL code. |
Apologies for the review requests. |
flink-connector-jdbc/archunit-violations/6b9ab1b0-c14d-4667-bab5-407b81fba98b
Outdated
Show resolved
Hide resolved
...-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/PostgresTablePath.java
Outdated
Show resolved
Hide resolved
...-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/PostgresTablePath.java
Outdated
Show resolved
Hide resolved
...or-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/cratedb/CrateDBTypeMapper.java
Outdated
Show resolved
Hide resolved
...or-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/cratedb/CrateDBTypeMapper.java
Outdated
Show resolved
Hide resolved
...ctor-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/psql/PostgresTypeMapper.java
Outdated
Show resolved
Hide resolved
...ctor-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/psql/PostgresTypeMapper.java
Outdated
Show resolved
Hide resolved
...or-jdbc/src/test/java/org/apache/flink/connector/jdbc/databases/cratedb/CrateDBDatabase.java
Outdated
Show resolved
Hide resolved
...bc/src/main/java/org/apache/flink/connector/jdbc/internal/converter/CrateDBRowConverter.java
Outdated
Show resolved
Hide resolved
...g/apache/flink/connector/jdbc/internal/converter/AbstractPostgresCompatibleRowConverter.java
Outdated
Show resolved
Hide resolved
...ector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/cratedb/CrateDBDialect.java
Outdated
Show resolved
Hide resolved
@eskabetxe When you have the time, please take another look. |
Checking the test failure because of different Timezone (UTC vs Europe/Athens that I have locally) |
@matriv Could you rebase and take the latest changes from @eskabetxe into account that were introduced via #22 ? |
@MartijnVisser done! |
apologies, I think you need to rerun the CI as I've pushed one more commit. |
I started it after you pushed it, so it's reflecting the current state of the PR. |
Asked because I see that jobs are cancelled: https://github.com/apache/flink-connector-jdbc/actions/runs/5068186731/jobs/9100199661?pr=29#step:13:347 |
That's because the run for Flink 1.17.0 on Java 11 already failed, so then it cancels all others run too |
Any hints? locally I don't get such error. |
looks like different jna versions do not pass convergence check
do we need crate's dependency on jna or can we exclude it? |
We can exclude it. |
thx @snuyanzin, excluded the |
@MartijnVisser @snuyanzin I've rebased again, can you please run ci again? |
...k-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/JdbcCatalogUtils.java
Outdated
Show resolved
Hide resolved
Thanks for addressing comments Thanks for review @eskabetxe @libenchao, please add anything if you have something not covered |
@snuyanzin I don't have further comments. There is one thing we can do is to create a Jira about the translation for newly added docs about CrateDB. |
Thx @libenchao! Created subtask issue: https://issues.apache.org/jira/browse/FLINK-32235 |
thanks for the contribution @matriv i'm about to merge it this weekend |
Thank you all involved in the PR and for all the iterations! |
Awesome work, congrats on your first merged pull request! |
Add support for CrateDB