diqiu50 opened a new issue, #12929:
URL: https://github.com/apache/gravitino/issues/12929

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   Flink SQL scans on a Gravitino `jdbc-postgresql` catalog table use the 
PostgreSQL schema name (e.g. `public`) as the JDBC connection database, instead 
of the catalog's real `jdbc-database`. Catalog browsing (`SHOW DATABASES`, 
`SHOW TABLES`) works fine; only the table scan connection is wrong.
   
   ### Error message and/or stacktrace
   
   ```text
   org.postgresql.util.PSQLException: FATAL: database "public" does not exist
   ```
   
   ### How to reproduce
   
   1. Create a `jdbc-postgresql` catalog with `jdbc-database=gravitino`, schema 
`public`, table `t`.
   2. `USE CATALOG` / `SHOW TABLES FROM public` succeed.
   3. `SELECT * FROM catalog.public.t` fails with the error above.
   
   ### Additional context
   
   Root cause: `JdbcPropertiesConverter#toFlinkTableProperties` appends the 
Flink "database" (= Gravitino schema) to the base JDBC URL. Correct for MySQL 
(database == schema there), wrong for PostgreSQL (they're distinct).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to