apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
1.04k stars 322 forks source link

[Improvement] Trim database value in the JDBC URI #4884

Open yuqi1129 opened 1 month ago

yuqi1129 commented 1 month ago

What would you like to be improved?

All databases can be viewed, even if the user specifies a JDBC URI with a schema name when creating a JDBC catalog like MySQL or PostgreSQL. For example, if the JDBC URL is jdbc:mysql://127.0.0.1:33540/db1, when we uses listSchema API to list schemes in the catalog, some other schemas can still be seen.

How should we improve?

So I suggest we shorten the last database name to in the creating process.

diqiu50 commented 1 month ago

In the Trino, the mysql connector only supports the jdbc url without a database. But, the postgressql connector only supports the url with a database.
What do you want to do about it? If the Graviton server does not report an error, do I need to make it compatible or report an error on the Trino connector

yuqi1129 commented 1 month ago

the postgressql connector only supports the url with a database

This shouldn't be an issue. In Gravitino, each PostgreSQL catalog is separated by database, so it seems be to okay for PG. I will only trim the database for MySQL, Doris, and leave PostgreSQL as is.

diqiu50 commented 1 month ago

I think it should throw an error instead of trimming the database.