RoanHeNaN opened a new pull request, #66973: URL: https://github.com/apache/doris/pull/66973
## Proposed changes Creating an `INVERTED` index on **AGG_KEYS** tables or **merge-on-read** `UNIQUE_KEYS` tables (`enable_unique_key_merge_on_write = false`) has ill-defined semantics: rows may be aggregated or replaced, so tokenized search / relevance scoring over the index is not well-defined. Previously such indexes were only partially restricted (value columns of AGG tables, parser indexes on MOR value columns), leaving **key-column** inverted indexes allowed. This PR forbids inverted indexes on these table types entirely, and rejects `score()` on them. ### FE changes - `IndexDefinition.checkColumn` (both overloads): reject `INVERTED` index on `AGG_KEYS` and merge-on-read `UNIQUE_KEYS` tables entirely, even on key columns. The pre-existing rule that other index types on AGG tables are only allowed on key columns is preserved; the now-dead "MOR value column + parser" branch is removed. Covers both `CREATE TABLE` and `ALTER TABLE ADD INDEX`. - `PushDownScoreTopNIntoOlapScan`: reject `score()` on `AGG_KEYS` / merge-on-read `UNIQUE_KEYS` tables with a clear error, instead of a misleading downstream "missing MATCH" failure. Default (merge-on-write) `UNIQUE_KEYS` tables and `DUP_KEYS` tables are unaffected. Existing tables loaded via edit-log replay are unaffected (replay does not run `checkColumn`). ### Regression tests - Remove obsolete tests that built inverted indexes on AGG/MOR tables. - Drop the offending inverted indexes from tests where they were incidental (load / bitmap / show-create fixtures), preserving each test's real intent (e.g. the show-create fixture switches to `USING BITMAP`; the warm-up test switches the table to merge-on-write). - Add `test_inverted_index_agg_mor_forbidden` covering the new prohibitions (CREATE/ALTER on AGG and MOR key/value columns, `score()` on AGG/MOR) plus a merge-on-write positive sanity check. Follow-up to #65916. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
