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

[FLINK-31551] Add support for CrateDB #29

Merged
merged 23 commits into from
Jun 3, 2023
Merged

Conversation

matriv
Copy link
Contributor

@matriv matriv commented Mar 21, 2023

Add support for CrateDB

@boring-cyborg
Copy link

boring-cyborg bot commented Mar 21, 2023

Thanks for opening this pull request! Please check out our contributing guidelines. (https://flink.apache.org/contributing/how-to-contribute.html)

Copy link
Member

@libenchao libenchao left a 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/) |
Copy link
Member

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?

Copy link
Member

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

Copy link
Contributor Author

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?

Copy link
Member

@eskabetxe eskabetxe left a 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?

@matriv
Copy link
Contributor Author

matriv commented Mar 27, 2023

Thx a lot both of you for the review.
I'll try to address the comments soon and ask for another round.

@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 cratedb:// urls.

Definitely I will try to avoid duplication and use more from the PostgreSQL code.

@matriv
Copy link
Contributor Author

matriv commented Mar 29, 2023

Apologies for the review requests.
I thought it was some github hiccup, but I apparently I cannot ask for re-review from both?

@matriv matriv requested a review from eskabetxe March 29, 2023 14:36
@matriv matriv requested a review from eskabetxe March 29, 2023 15:24
@matriv
Copy link
Contributor Author

matriv commented Mar 31, 2023

@eskabetxe When you have the time, please take another look.

@matriv
Copy link
Contributor Author

matriv commented Apr 5, 2023

Checking the test failure because of different Timezone (UTC vs Europe/Athens that I have locally)

@MartijnVisser
Copy link
Contributor

@matriv Could you rebase and take the latest changes from @eskabetxe into account that were introduced via #22 ?

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

@MartijnVisser done!

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

apologies, I think you need to rerun the CI as I've pushed one more commit.

@MartijnVisser
Copy link
Contributor

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.

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

@MartijnVisser
Copy link
Contributor

Asked because I see that jobs are cancelled

That's because the run for Flink 1.17.0 on Java 11 already failed, so then it cancels all others run too

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

Any hints? locally I don't get such error.

@snuyanzin
Copy link
Contributor

snuyanzin commented May 24, 2023

looks like different jna versions do not pass convergence check
this command fails locally

mvn clean install -DskipTests -Dflink.convergence.phase=install -Pcheck-convergence
Dependency convergence error for net.java.dev.jna:jna:4.2.1 paths to dependency are:
+-org.apache.flink:flink-connector-jdbc:3.2-SNAPSHOT
  +-io.crate:crate-jdbc:2.7.0
    +-com.github.dblock.waffle:waffle-jna:1.7.5
      +-net.java.dev.jna:jna:4.2.1
and
+-org.apache.flink:flink-connector-jdbc:3.2-SNAPSHOT
  +-io.crate:crate-jdbc:2.7.0
    +-net.java.dev.jna:jna:4.2.1
and
+-org.apache.flink:flink-connector-jdbc:3.2-SNAPSHOT
  +-io.crate:crate-jdbc:2.7.0
    +-net.java.dev.jna:jna-platform:4.2.1
      +-net.java.dev.jna:jna:4.2.1
and
+-org.apache.flink:flink-connector-jdbc:3.2-SNAPSHOT
  +-org.testcontainers:junit-jupiter:1.17.2
    +-org.testcontainers:testcontainers:1.17.2
      +-com.github.docker-java:docker-java-transport-zerodep:3.2.13
        +-net.java.dev.jna:jna:5.8.0

[WARNING] Rule 0: org.apache.maven.plugins.enforcer.DependencyConvergence failed with message:
Failed while enforcing releasability. See above detailed error message.

do we need crate's dependency on jna or can we exclude it?

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

do we need crate's dependency on jna or can we exclude it?

We can exclude it.

@matriv
Copy link
Contributor Author

matriv commented May 24, 2023

thx @snuyanzin, excluded the jna dependency from crate-jdbc.

@matriv
Copy link
Contributor Author

matriv commented May 26, 2023

@MartijnVisser @snuyanzin I've rebased again, can you please run ci again?
It would be great to merge it if everything passes, thx.

@snuyanzin
Copy link
Contributor

Thanks for addressing comments
it looks ok from my side

Thanks for review @eskabetxe @libenchao, please add anything if you have something not covered

@libenchao
Copy link
Member

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

@matriv
Copy link
Contributor Author

matriv commented Jun 1, 2023

Thx @libenchao! Created subtask issue: https://issues.apache.org/jira/browse/FLINK-32235

@snuyanzin
Copy link
Contributor

thanks for the contribution @matriv
thanks for the review @libenchao , @eskabetxe

i'm about to merge it this weekend

@matriv
Copy link
Contributor Author

matriv commented Jun 2, 2023

Thank you all involved in the PR and for all the iterations!

@snuyanzin snuyanzin merged commit d67de5f into apache:main Jun 3, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Jun 3, 2023

Awesome work, congrats on your first merged pull request!

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.

5 participants