You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-54111][CONNECT] Support getCatalogs for SparkConnectDatabaseMetaData
### What changes were proposed in this pull request?
Implement `getCatalogs` defined in `java.sql.DatabaseMetaData` for `SparkConnectDatabaseMetaData`.
```java
/**
* Retrieves the catalog names available in this database. The results
* are ordered by catalog name.
*
* <P>The catalog column is:
* <OL>
* <LI><B>TABLE_CAT</B> String {code =>} catalog name
* </OL>
*
* return a {code ResultSet} object in which each row has a
* single {code String} column that is a catalog name
* throws SQLException if a database access error occurs
*/
ResultSet getCatalogs() throws SQLException;
```
### Why are the changes needed?
Enhance API coverage of the Connect JDBC driver, for example, `get[Catalogs|Schemas|Tables|...]` APIs are used by SQL GUI tools such as DBeaver for displaying the tree category.
### Does this PR introduce _any_ user-facing change?
No, the Connect JDBC driver is a new feature under development.
### How was this patch tested?
New UT is added.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#52815 from pan3793/SPARK-54111.
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
(cherry picked from commit 2be1eb7)
Signed-off-by: yangjie01 <[email protected]>
Copy file name to clipboardExpand all lines: sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectDatabaseMetaData.scala
Copy file name to clipboardExpand all lines: sql/connect/client/jdbc/src/test/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectDatabaseMetaDataSuite.scala
0 commit comments