Skip to content

Conversation

@KodaiD
Copy link
Contributor

@KodaiD KodaiD commented Nov 7, 2025

Description

This PR adds validation for secondary indexes in table metadata with Object Storage. Some integration tests are also updated to prepare table metadata without secondary indexes.

Related issues and/or PRs

Changes made

  • Updated ObjectStorageAdmin to include validation for secondary indexes in the specified table metadata.
  • Updated integration tests for Object Storage adapter to prepare table metadata without secondary indexes.

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • I have considered whether similar issues could occur in other products, components, or modules if this PR is for bug fixes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

N/A

@KodaiD KodaiD self-assigned this Nov 7, 2025
@KodaiD KodaiD added the bugfix label Nov 7, 2025
@KodaiD
Copy link
Contributor Author

KodaiD commented Nov 7, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively adds validation to ObjectStorageAdmin to prevent the use of unsupported secondary indexes. The corresponding updates to the integration tests are well-executed, particularly the refactoring of base test classes to accommodate storage-specific metadata, which improves test extensibility. I have one piece of feedback regarding an error message in ObjectStorageAdmin.java that seems to have been copied from another storage implementation and could be misleading.

@KodaiD KodaiD marked this pull request as ready for review November 7, 2025 01:44
@KodaiD KodaiD requested review from a team, Torch3333, brfrn169, Copilot, feeblefakie and komamitsu and removed request for a team November 7, 2025 01:44
Copy link
Contributor

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 adds metadata validation to ObjectStorage to prevent unsupported features like secondary indexes and BLOB clustering keys. The changes introduce a checkMetadata() method in ObjectStorageAdmin that validates table metadata during table creation and repair operations. Integration test base classes are modified to allow subclasses to override table metadata, enabling ObjectStorage-specific tests to provide custom metadata without secondary indexes.

  • Adds validation in ObjectStorageAdmin to reject secondary indexes and BLOB-type clustering keys
  • Introduces a new error constant OBJECT_STORAGE_CLUSTERING_KEY_BLOB_TYPE_NOT_SUPPORTED
  • Refactors integration test base classes to support customizable table metadata via getTableMetadata() method

Reviewed Changes

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

Show a summary per file
File Description
ObjectStorageAdmin.java Implements checkMetadata() validation method and integrates it into createTable() and repairTable()
CoreError.java Adds new error constant for BLOB clustering key validation
DistributedTransactionAdminRepairIntegrationTestBase.java Changes visibility of COL_NAME12-15 constants from private to protected
DistributedTransactionAdminIntegrationTestBase.java Adds getTableMetadata() method and updates tests to use it for flexible metadata
DistributedStorageAdminRepairIntegrationTestBase.java Changes visibility of all COL_NAME constants from private to protected
DistributedStorageAdminIntegrationTestBase.java Updates tests to use dynamic metadata from getTableMetadata()
ObjectStorage integration test files Override getTableMetadata() to provide metadata without secondary indexes for ObjectStorage tests

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

@KodaiD
Copy link
Contributor Author

KodaiD commented Nov 7, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively adds validation to prevent the use of unsupported secondary indexes with Object Storage by checking the table metadata during table creation and repair. The changes in ObjectStorageAdmin.java are clear and correctly placed. The updates to integration tests to remove secondary indexes are necessary and well-executed. Additionally, the refactoring in the base test classes to make secondary index assertions more dynamic is a welcome improvement to test maintainability. I've provided a few suggestions to further improve the test code by simplifying assertions and reducing duplication.

@KodaiD KodaiD requested a review from Copilot November 7, 2025 02:28
Copy link
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie enabled auto-merge (squash) November 10, 2025 06:52
@feeblefakie feeblefakie merged commit ad27355 into master Nov 10, 2025
67 of 68 checks passed
@feeblefakie feeblefakie deleted the validate-secondary-index-with-object-storage branch November 10, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants