gravitino icon indicating copy to clipboard operation
gravitino copied to clipboard

[#6233] feat(flink): flink jdbc catalog

Open hdygxsj opened this issue 10 months ago • 2 comments

What changes were proposed in this pull request?

Provide flink jdbc catalog

Why are the changes needed?

close #6233

Does this PR introduce any user-facing change?

None

How was this patch tested?

org.apache.gravitino.flink.connector.integration.test.jdbc.FlinkJdbcMysqlCatalogIT org.apache.gravitino.flink.connector.jdbc.TestJdbcPropertiesConverter

hdygxsj avatar Feb 26 '25 17:02 hdygxsj

Thanks for the PR, could you add a related document? And besides Mysql, does Flink JDBC connector support other RDMS?

FANNG1 avatar Feb 27 '25 06:02 FANNG1

Thanks for the PR, could you add a related document? And besides Mysql, does Flink JDBC connector support other RDMS?

The FlinkJdbcCatalog supports only MySQL and PostgreSQL databases.

hdygxsj avatar Feb 27 '25 14:02 hdygxsj

@hdygxsj could you summarize the process logic about the jdbc URL properties when loading catalog and tables? I'm confused by the logic.

FANNG1 avatar Mar 17 '25 13:03 FANNG1

@hdygxsj could you summarize the process logic the jdbc URL properties when loading catalog and tables? I'm confused by the logic.

When creating a FlinkJdbcCatalog, you need to specify the baseUrl, which includes the protocol, IP address, and port. When the FlinkJdbcCatalog creates a table, it passes the databaseUrl to the table's options. The databaseUrl includes the protocol, IP address, port, and the database where the table is located.

The following is the source code of FlinkJdbcCatalog.getTable, which demonstrates the relationship between URLs when loading a table and creating a catalog. image

hdygxsj avatar Mar 17 '25 13:03 hdygxsj

@hdygxsj LGTM except minor comments, there are some other works like adding document and add integration test for PG, would you like to create issue to track it or add it in this PR? both ok for me.

FANNG1 avatar Mar 18 '25 07:03 FANNG1

@hdygxsj merged to main, thanks for your work

FANNG1 avatar Mar 19 '25 01:03 FANNG1