Skip to content

Commit

Permalink
[KYUUBI #2720] Fix KyuubiDatabaseMetaData#supportsCatalogs*
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

`KyuubiDatabaseMetaData#supportsCatalogs*` should return `true` as Kyuubi support concept `catalog`, otherwise, some GUI tools like DBeaver does not work as exptected.

![image](https://user-images.githubusercontent.com/26535726/169709784-50bc63c5-980b-47e5-aba6-1227ee6e05e6.png)

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [x] Add screenshots for manual tests if appropriate
![image](https://user-images.githubusercontent.com/26535726/169709643-526976fb-3782-4d21-9813-d00f58c1561e.png)

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #2720 from pan3793/jdbc-catalog.

Closes #2720

71217ca [Cheng Pan] ut
012393f [Cheng Pan] ut
e600458 [Cheng Pan] revert
0cfbc25 [Cheng Pan] Fix KyuubiDatabaseMetaData#supportsCatalogs*

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 9578475)
Signed-off-by: Cheng Pan <chengpan@apache.org>
  • Loading branch information
pan3793 committed May 23, 2022
1 parent 7e9511a commit 268d1b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,20 +432,18 @@ trait SparkMetadataTests extends HiveJDBCTestHelper {
assert(metaData.supportsLimitedOuterJoins)
assert(metaData.getSchemaTerm === "database")
assert(metaData.getProcedureTerm === "UDF")
assert(metaData.getCatalogTerm === "instance")
assert(metaData.getCatalogTerm === "catalog")
assert(metaData.getCatalogSeparator === ".")
assert(metaData.supportsSchemasInDataManipulation)
assert(!metaData.supportsSchemasInProcedureCalls)
assert(metaData.supportsSchemasInTableDefinitions)
assert(!metaData.supportsSchemasInIndexDefinitions)
assert(!metaData.supportsSchemasInPrivilegeDefinitions)
// This is actually supported, but hive jdbc package return false
assert(!metaData.supportsCatalogsInDataManipulation)
assert(!metaData.supportsCatalogsInProcedureCalls)
// This is actually supported, but hive jdbc package return false
assert(!metaData.supportsCatalogsInTableDefinitions)
assert(!metaData.supportsCatalogsInIndexDefinitions)
assert(!metaData.supportsCatalogsInPrivilegeDefinitions)
assert(metaData.supportsCatalogsInDataManipulation)
assert(metaData.supportsCatalogsInProcedureCalls)
assert(metaData.supportsCatalogsInTableDefinitions)
assert(metaData.supportsCatalogsInIndexDefinitions)
assert(metaData.supportsCatalogsInPrivilegeDefinitions)
assert(!metaData.supportsPositionedDelete)
assert(!metaData.supportsPositionedUpdate)
assert(!metaData.supportsSelectForUpdate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public String getCatalogSeparator() throws SQLException {
}

public String getCatalogTerm() throws SQLException {
return "instance";
return "catalog";
}

public ResultSet getCatalogs() throws SQLException {
Expand Down Expand Up @@ -952,23 +952,23 @@ public boolean supportsBatchUpdates() throws SQLException {
}

public boolean supportsCatalogsInDataManipulation() throws SQLException {
return false;
return true;
}

public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
return false;
return true;
}

public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
return false;
return true;
}

public boolean supportsCatalogsInProcedureCalls() throws SQLException {
return false;
return true;
}

public boolean supportsCatalogsInTableDefinitions() throws SQLException {
return false;
return true;
}

public boolean supportsColumnAliasing() throws SQLException {
Expand Down

0 comments on commit 268d1b2

Please sign in to comment.