[feature](inverted index) support DROP INDEX ON PARTITION for inverted index#62181
Merged
airborne12 merged 4 commits intoapache:masterfrom Apr 9, 2026
Merged
Conversation
…d index Add partition-level DROP INDEX support for inverted indexes. This allows users to delete physical inverted index files on specified partitions without removing the table-level index metadata definition. Syntax: DROP INDEX idx_name ON table_name PARTITIONS (p1, p2); ALTER TABLE table_name DROP INDEX idx_name PARTITION (p1); When partitions are specified, only the physical index files on those partitions are deleted via IndexChangeJob. The index definition remains in the table schema, and queries on affected partitions automatically fallback to non-index scan via enable_fallback_on_missing_inverted_index. This is the inverse of BUILD INDEX ON PARTITION and works in both storage-compute separation (cloud) and storage-compute integrated (local) modes without any BE-side or cloud meta service changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
…d strengthen tests 1. P1: Reject PARTITIONS (*) in DropIndexOp.validate() — previously caused NPE when PartitionNamesInfo.getPartitionNames() returned null. 2. P1: Reject TEMPORARY PARTITION in DropIndexOp.validate() — previously silently accepted but no delete job was created (correctness bug). 3. P2: Strengthen regression tests — assert job count increment after DROP INDEX ON PARTITION, and verify with enable_fallback_on_missing_inverted_index=false that index files were actually deleted on dropped partitions. 4. P2: Add error cases for PARTITIONS (*) and TEMPORARY PARTITION. 5. Add FE unit tests covering validate() and SchemaChangeHandler.process() error paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
…tions - Replace all order_qt_* queries with sql + assertEquals to avoid dependency on .out files - Remove fallback=false exception test — INVERTED_INDEX_FILE_NOT_FOUND is a BE internal status code that doesn't propagate to SQL client - Keep job count increment assertions as the reliable verification that DROP INDEX ON PARTITION jobs are actually created Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
run buildall |
…tion NGRAM_BF CREATE INDEX goes through schema change in cloud mode, not lightweight index change. Use wait_for_last_col_change_finish instead of build_index_on_table to avoid race condition where BUILD INDEX runs before schema change completes.
Member
Author
|
run buildall |
gavinchou
approved these changes
Apr 9, 2026
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
zhiqiang-hhhh
approved these changes
Apr 9, 2026
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 problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
Currently,
DROP INDEXonly supports table-level operations — it removes both the index metadata and physical index files across all partitions. In contrast,BUILD INDEXalready supports partition-level operations viaBUILD INDEX ON PARTITION.This PR adds the corresponding inverse operation:
DROP INDEX ON PARTITION, which deletes only the physical inverted index files on specified partitions while preserving the table-level index definition. This is useful for:Syntax:
Key design decisions:
enable_fallback_on_missing_inverted_index(default: true)IndexChangeJobandbuildOrDeleteTableInvertedIndicesinfrastructureRelease note
Support
DROP INDEX ON PARTITIONfor inverted indexes, allowing users to delete physical index files on specified partitions without removing the table-level index definition.Check List (For Author)
Test
Behavior changed:
DROP INDEX ... PARTITION/PARTITIONS (...)that was previously not supported. ExistingDROP INDEXbehavior without partition spec is unchanged.Does this need documentation?
Check List (For Reviewer who merge this PR)