Support ALL CATALOGS in GetTables for SQL Execution API#815
Merged
Conversation
…w-tables-all-catalogs
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the SQL Execution API to support fetching tables and views from all catalogs by leveraging the new SHOW TABLES FROM/IN ALL CATALOGS command. Key changes include updating error handling for null or wildcard catalog values in the CommandBuilder, removing an unnecessary exception in the metadata client's listTables tests, and updating related tests and constants.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/test/java/com/databricks/jdbc/dbclient/impl/sqlexec/DatabricksMetadataSdkClientTest.java | Removed exception assertion for listTables when catalog is null to support multi-catalog behavior. |
| src/test/java/com/databricks/jdbc/dbclient/impl/sqlexec/CommandBuilderTest.java | Added tests covering new scenarios for listTables SQL generation, including all catalogs and wildcard catalog cases. |
| src/main/java/com/databricks/jdbc/dbclient/impl/sqlexec/CommandBuilder.java | Updated SQL generation logic to handle null or wildcard catalog values by using SHOW TABLES IN ALL CATALOGS. |
| src/main/java/com/databricks/jdbc/dbclient/impl/common/CommandConstants.java | Added new constant for SHOW_TABLES_IN_ALL_CATALOGS_SQL and removed an unused constant. |
| NEXT_CHANGELOG.md | Updated changelog to document the new multi-catalog support. |
Comments suppressed due to low confidence (1)
src/test/java/com/databricks/jdbc/dbclient/impl/sqlexec/DatabricksMetadataSdkClientTest.java:750
- Since null catalogs are now supported for listTables, consider adding a test to verify the correct behavior (e.g., verifying the returned SQL or result) instead of asserting an exception.
assertThrows( DatabricksValidationException.class, () -> metadataClient.listTables(session, null, TEST_SCHEMA, TEST_TABLE, null));
gopalldb
reviewed
May 9, 2025
gopalldb
approved these changes
May 12, 2025
…w-tables-all-catalogs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DBR now supports retrieving tables and views from all catalogs using the SQL command SHOW TABLES FROM/IN ALL CATALOGS .... This pull request updates the SQL Exec API metadata client to leverage this command when the catalog parameter is set to null in the DatabaseMetaData#getTables method.
Testing
Additional Notes to the Reviewer