fix(hive): expose databases through database metadata - #2855
Merged
Conversation
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.
Related issue
N/A (no issue number supplied)
Summary
Expose Hive namespaces as database nodes instead of schema nodes.
SHOW DATABASESnow populatesDatabasemetadata, Hive schema metadata is empty, and Hive qualified table names preserve the database prefix. JDBC drivers that do not implementDatabaseMetaData.getURL()no longer make schema listing fail; ordering is skipped instead.Affected surfaces
Verification
mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-hive -am -Dmaven.test.skip=false -DskipTests=false -Dtest=HiveMetaDataTest,HiveIdentifierProcessorTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false test-> 30 tests passed.mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-domain-core -am -Dmaven.test.skip=false -DskipTests=false -Dtest=DbDatabaseServiceImplTest -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false test-> 1 test passed.-Dsurefire.includes=**/*Test.java-> 36 Hive tests passed; reactor tests passed.mvn -B -f chat2db-community-server/pom.xml -pl :chat2db-community-hive,:chat2db-community-domain-core -am -Dmaven.test.skip=true package-> package compilation passed; tests intentionally skipped for this command.yarn exec tsx src/utils/databaseJudgments.test.ts-> all assertions passed.yarn run lint-> ESLint and Stylelint passed.yarn run build:web:community --app_version=0.0.0-> Community regression tests, Webpack build, and production bundle verification passed.127.0.0.1:10000with the supplied Hive JDBC driver and no credentials.SHOW DATABASESreturneddefault.DatabaseMetaData.getURL()returnedjava.sql.SQLException: Method not supported.HiveMetaData.databases()implementation returned[default]over that real JDBC connection.Risk and compatibility
Reviewer map
chat2db-community-plugins/chat2db-community-hive/src/main/java/ai/chat2db/plugin/hive/HiveMetaData.javaandchat2db-community-plugins/chat2db-community-hive/src/main/resources/ai/chat2db/plugin/hive/hive.json.DatabaseMetaData.getURL()must not prevent metadata lists from being returned.a3687c63df908bc79533424ca8c4fa301252a452; no migration or data rollback is required.Contributor declaration
AI assistance: Substantial AI assistance was used for implementation, tests, and verification.