eldenmoon opened a new pull request, #61190:
URL: https://github.com/apache/doris/pull/61190

   VARIANT root columns do not have inverted indexes built on them directly;
   only typed sub-columns extracted via `response['field']` carry per-field
   indexes. Issuing `response MATCH 'xxx'` on a root VARIANT slot silently
   falls through to a full scan without any index acceleration, returning
   unexpected results or errors.
   
   Add a check in `CheckMatchExpression` that inspects the resolved
   SlotReference after unwinding any Cast chain. If the slot is a
   VARIANT type and has no sub-column path, the planner now throws an
   AnalysisException with a clear message suggesting the correct
   `column['field'] MATCH 'xxx'` syntax.
   
   Refactor `isSlotOrCastChainOnSlot` → `getSlotFromSlotOrCastChain` to
   return the actual SlotReference (or null) so the caller can inspect the
   slot's type and sub-column path without a second traversal.
   Add unit tests (CheckMatchExpressionTest) covering:
   - Root VARIANT slot → rejected
   - CAST(root VARIANT) → rejected
   - VARIANT sub-column slot → allowed
   Add regression test (test_disable_root_variant_match) that creates a
   VARIANT column with a MATCH_NAME inverted index, verifies root MATCH is
   rejected with the expected error, and confirms sub-column MATCH still
   returns correct results.


-- 
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]

Reply via email to