Skip to content

fix(hive): expose databases through database metadata - #2855

Merged
openai0229 merged 1 commit into
mainfrom
fix/hive-database-metadata
Aug 31, 2026
Merged

fix(hive): expose databases through database metadata#2855
openai0229 merged 1 commit into
mainfrom
fix/hive-database-metadata

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

N/A (no issue number supplied)

Summary

Expose Hive namespaces as database nodes instead of schema nodes. SHOW DATABASES now populates Database metadata, Hive schema metadata is empty, and Hive qualified table names preserve the database prefix. JDBC drivers that do not implement DatabaseMetaData.getURL() no longer make schema listing fail; ordering is skipped instead.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • 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.
    • Hive module full test reactor with -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.
  • Manual verification:
    • Connected to the local HiveServer2 test container at 127.0.0.1:10000 with the supplied Hive JDBC driver and no credentials. SHOW DATABASES returned default.
    • The same driver successfully connected but DatabaseMetaData.getURL() returned java.sql.SQLException: Method not supported.
    • The built HiveMetaData.databases() implementation returned [default] over that real JDBC connection.
  • UI evidence: N/A

Risk and compatibility

  • Public API or stored data: N/A; response types are unchanged.
  • Database or driver compatibility: Hive is now represented by its native database namespace; unsupported optional JDBC URL metadata is non-fatal.
  • Network, privacy, or security: N/A; verification used only the local test container and no credentials.
  • Community / Local / Pro boundary: Community source only; no Pro or Local code changed.
  • Backward compatibility: Existing Hive cached schema entries are bypassed by the new database capability path; direct schema calls return an empty list as Hive has no separate schema namespace.

Reviewer map

  • Start here: chat2db-community-plugins/chat2db-community-hive/src/main/java/ai/chat2db/plugin/hive/HiveMetaData.java and chat2db-community-plugins/chat2db-community-hive/src/main/resources/ai/chat2db/plugin/hive/hive.json.
  • Failure condition: A driver that throws from optional DatabaseMetaData.getURL() must not prevent metadata lists from being returned.
  • Rollback or disable path: Revert commit a3687c63df908bc79533424ca8c4fa301252a452; no migration or data rollback is required.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Substantial AI assistance was used for implementation, tests, and verification.

@openai0229
openai0229 requested review from a team and Aias00 as code owners August 31, 2026 14:48
@openai0229 openai0229 moved this to In Review in Chat2DB Community Aug 31, 2026
@openai0229
openai0229 merged commit fbca08b into main Aug 31, 2026
19 checks passed
@openai0229
openai0229 deleted the fix/hive-database-metadata branch August 31, 2026 15:37
@openai0229 openai0229 moved this from In Review to Done in Chat2DB Community Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant