Skip to content

HIVE-29672: Extract column stats, constraints, token, and WM logic from ObjectStore#6552

Merged
dengzhhu653 merged 23 commits into
apache:masterfrom
dengzhhu653:HIVE-29672
Jul 7, 2026
Merged

HIVE-29672: Extract column stats, constraints, token, and WM logic from ObjectStore#6552
dengzhhu653 merged 23 commits into
apache:masterfrom
dengzhhu653:HIVE-29672

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?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the standalone metastore RawStore surface by introducing dedicated sub-store interfaces/implementations (e.g., column stats, constraints, WLM) and wiring many former RawStore methods through new default delegations. It also updates metastore tests and verification helpers to exercise the new store boundaries (including DirectSQL vs JDO comparison paths).

Changes:

  • Add new metastore sub-store interfaces (ColStatsStore, ConstraintStore, WLMStore) and implementations (ColStatsStoreImpl, ConstraintStoreImpl, WLMStoreImpl).
  • Convert a number of RawStore methods into default methods delegating to unwrap(...) stores; adjust CachedStore and tests accordingly.
  • Update VerifyingObjectStore to verify column-stats and partition-stats behavior via ColStatsStore/TableStore under DirectSQL configurator toggling.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/VerifyingObjectStore.java Switches verification logic to ColStatsStore/TableStore with DirectSQL toggling.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java Updates a column-validation test to call ColStatsStoreImpl.validateTableCols.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java Adds default delegations to ColStatsStore/ConstraintStore/WLMStore via unwrap.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/WLMStoreImpl.java New WLM store implementation extracted into its own class.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/TableStoreImpl.java Refactors table/partition conversion helpers and adds getMTable(TableName, ...).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/ConstraintStoreImpl.java New constraints store implementation (PK/FK/UK/NN/DC/CC operations).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/impl/ColStatsStoreImpl.java New column-stats store implementation (read/update/delete/aggregate paths).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/iface/WLMStore.java New WLM store interface with @MetaDescriptor.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/iface/TableStore.java Adds AttachedMTableInfo and getMTable(TableName, ...).
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/iface/ConstraintStore.java New constraint store interface with @MetaDescriptor.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/iface/ColStatsStore.java New column-stats store interface with @MetaDescriptor.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/metastore/GetHelper.java Exposes savepoint helpers (now public) for use by new store implementations.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java Removes methods now satisfied by RawStore defaults (delegation via unwrap).

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

Comment on lines +347 to +351
final String fkColType = getColumnFromTableColumns(childCols, fkColumnName).getType();
fkSignature.append(
generateColNameTypeSignature(fkColumnName, fkColType));
referencedKSignature.append(
generateColNameTypeSignature(pkColumnName, fkColType));

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 13 out of 14 changed files in this pull request and generated 11 comments.

@dengzhhu653

Copy link
Copy Markdown
Member Author

I assume this is the last biggest refactors, @ngsg @deniskuzZ @wecharyu @okumin could you take a look if have secs? Thanks in advance!

@dengzhhu653 dengzhhu653 marked this pull request as ready for review June 20, 2026 23:53
@dengzhhu653 dengzhhu653 changed the title HIVE-29672 HIVE-29672: Extract column stats, constraints, token, and WM logic from ObjectStore Jun 24, 2026

@ngsg ngsg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I read through the changes. Most of them look like extensions of the previous refactoring patch and seem fine to me. I left comments where I have questions. Could you please take a look? Thank you.

@saihemanth-cloudera saihemanth-cloudera left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM +1

@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@dengzhhu653

Copy link
Copy Markdown
Member Author

The partition_type_check.q seems flaky, which I couldn't repeat the same locally, filed HIVE-29700 to track it

@dengzhhu653 dengzhhu653 merged commit a761ca6 into apache:master Jul 7, 2026
3 of 4 checks passed
@dengzhhu653 dengzhhu653 deleted the HIVE-29672 branch July 7, 2026 03:40
@dengzhhu653

dengzhhu653 commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

The recent 3 runs are failed by the same TestMiniLlapLocalCliDriver[partition_type_check], will track this failure in HIVE-29700. Thank you for the review @ngsg @saihemanth-cloudera!
If you find issue with this PR, please file a new jira. Thank you!

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.

5 participants