PHOENIX-6868 - Inheritable table level properties from data table to indexes - #2612
Open
ujjawal4046 wants to merge 1 commit into
Open
PHOENIX-6868 - Inheritable table level properties from data table to indexes#2612ujjawal4046 wants to merge 1 commit into
ujjawal4046 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There is an inconsistency in index-property validation (CDC index exemption vs other enforcement) and at least one misleading test comment that should be corrected before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds support for inheriting selected HBase TableDescriptor properties from a Phoenix data table to its index tables (PHOENIX-6868), controlled by a new configuration key.
Changes:
- Introduces
phoenix.index.inheritableTableDescriptorPropertiesto configure which custom table-descriptor properties should be propagated to index tables. - Implements inheritance of configured properties during index table descriptor generation and propagation on
ALTER TABLEto keep indexes in sync. - Adds end-to-end integration tests covering inheritance behavior and disallowing direct overrides on index tables.
File summaries
| File | Description |
|---|---|
| phoenix-core/src/it/java/org/apache/phoenix/end2end/InheritableTablePropertiesIT.java | Adds IT coverage for inheriting configured table-descriptor props to global/local/view indexes and for disallowing direct index overrides. |
| phoenix-core-client/src/main/java/org/apache/phoenix/util/MetaDataUtil.java | Adds helpers to parse configured inheritable table-descriptor properties and check whether a property is inheritable. |
| phoenix-core-client/src/main/java/org/apache/phoenix/schema/MetaDataClient.java | Rejects setting configured inheritable table-descriptor properties directly on index DDL. |
| phoenix-core-client/src/main/java/org/apache/phoenix/query/QueryServices.java | Adds the configuration key constant for inheritable table-descriptor properties. |
| phoenix-core-client/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java | Inherits configured props during index table descriptor generation and propagates changes to related index table descriptors during ALTER TABLE. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1215
to
+1222
| // PHOENIX-6868: Disallow setting inheritable table descriptor properties on indexes | ||
| if (tableType == PTableType.INDEX && !isCDCIndex | ||
| && MetaDataUtil.isInheritableTableDescriptorProperty( | ||
| connection.getQueryServices().getConfiguration(), prop.getFirst())) { | ||
| throw new SQLExceptionInfo.Builder( | ||
| SQLExceptionCode.CANNOT_SET_OR_ALTER_PROPERTY_FOR_INDEX) | ||
| .setMessage("Property: " + prop.getFirst()).build().buildException(); | ||
| } |
Comment on lines
+305
to
+307
| // Test when no inheritable properties are configured, custom properties should not propagate | ||
| // (this test uses the default configured properties from doSetup, so we check that only | ||
| // CUSTOM_PROP_1 and CUSTOM_PROP_2 propagate and nothing else) |
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.
What changes were proposed in this pull request?
phoenix.index.inheritableTableDescriptorPropertieswhich can be used to propagate custom table properties from parent to indexesWhy are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?