Skip to content

HIVE-29452: Split get table from HMSHandler#6427

Open
dengzhhu653 wants to merge 3 commits intoapache:masterfrom
dengzhhu653:HIVE-29452
Open

HIVE-29452: Split get table from HMSHandler#6427
dengzhhu653 wants to merge 3 commits intoapache:masterfrom
dengzhhu653:HIVE-29452

Conversation

@dengzhhu653
Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Why are the changes needed?

Does this PR introduce any user-facing change?

How was this patch tested?

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors Hive Metastore “get table”-related logic by moving several table retrieval/listing flows out of HMSHandler into a dedicated GetTableHandler request handler, aligning with the existing request-handler architecture used elsewhere in the standalone metastore server.

Changes:

  • Introduces GetTableHandler to centralize implementations for get_table_req, get_table_core, get_table_objects_by_name_req, and various table-name listing methods.
  • Updates HMSHandler to delegate these operations to GetTableHandler and removes now-duplicated helper logic.
  • Improves an UnsupportedOperationException message in GetPartitionsHandler to include the unsupported request object.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java Delegates multiple table APIs to the new GetTableHandler and removes inlined implementations.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/GetTableHandler.java New request handler consolidating table fetch/list logic previously in HMSHandler.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/GetPartitionsHandler.java Makes the “not yet implemented” exception include the request value for easier debugging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java:1449

  • In get_table_req, exceptions from GetTableHandler.getTable(...) aren't captured/passed to endFunction (the Exception argument is always null). This can hide failures from end-function listeners/metrics and produces misleading audit/telemetry. Capture the exception in a local Exception ex (as other HMSHandler methods do), rethrow it, and pass ex to endFunction.
  @Override
  public List<TableMeta> get_table_meta(String dbnames, String tblNames, List<String> tblTypes)
      throws MetaException, NoSuchObjectException {
    List<TableMeta> t = null;
    String[] parsedDbName = parseDbName(dbnames, conf);
    startTableFunction("get_table_metas", parsedDbName[CAT_NAME], parsedDbName[DB_NAME], tblNames);
    Exception ex = null;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants