You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "eldenmoon (via GitHub)" <gi...@apache.org> on 2026/10/17 14:29:08 UTC

[PR] branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH [doris]

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

   ### What problem does this PR solve?
   
   Issue Number: DORIS-29489
   
   Problem Summary:
   
   `SEARCH` with `score()` over a VARIANT sub-column fails on this branch with
   
   ```
   ERROR 1105 (HY000): errCode = 2, detailMessage = Index statistics collection failed:
   Not such column 2.v.content
   ```
   
   `SearchPredicateCollector::collect_from_leaf` resolved the clause's field name only through `tablet_schema->field_index(field_name)`. A VARIANT path such as `v.content` is not a tablet-schema column while the path is not materialized, so the clause returned early and the collection statistics were gathered for no field at all. The read side then asks the statistics for the same path (`<parent uid>.<parent>.<path>`, the Lucene field the index files were written with) and throws `INVERTED_INDEX_CLUCENE_ERROR` as `Not such column`.
   
   `MatchPredicateCollector` already resolves the same shapes from schema: materialized/typed paths, `field_pattern` templates, and a plain parent index inherited by the dynamic VARIANT placeholder. This PR moves that resolution into one helper (`resolve_scoring_index_candidates`) and uses it from the SEARCH collector too. When the clause field is not a tablet-schema column, the collector now builds the same synthetic VARIANT column the scan uses for a dynamic path (parent unique id + full path) and resolves it through the parent index, keeping the cloned index metadata alive through `CollectInfo::owned_index_meta`. Unresolvable names keep the previous skip, so only VARIANT paths gain collection.
   
   The regression suite reproduces the reported query (the same table as DORIS-29489) and also covers phrase scoring and a `field_pattern` VARIANT index.
   
   ### Release note
   
   `score()` now works over `SEARCH` on VARIANT sub-columns served by a parent VARIANT inverted index.
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Unit Test
         `CollectionStatisticsTest.ExtractSearchCollectInfoForVariantParentIndexWithoutTemplate` covers the collector resolution (`run-be-ut.sh`).
       - [x] Regression test
         `regression-test/suites/search/test_search_variant_subcolumn_bm25.groovy`.
       - [ ] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why below to give a good reason
   - Behavior changed: Yes (SEARCH + score() on VARIANT sub-columns returns scored rows instead of failing with `Not such column`)
   - Does this need documentation: No
   


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH [doris]

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #69214:
URL: https://github.com/apache/doris/pull/69214#issuecomment-6235093032

   
   Thank you for your contribution to Apache Doris.
   Don't know what should be done next? See [How to process your PR](https://doris.apache.org/community/how-to-contribute/review-and-ci).
   
   Please clearly describe your PR:
   1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
   2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
   3. What features were added. Why was this function added?
   4. Which code was refactored and why was this part of the code refactored?
   5. Which functions were optimized and what is the difference before and after the optimization?
       


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH [doris]

Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on PR #69214:
URL: https://github.com/apache/doris/pull/69214#issuecomment-6235406652

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH [doris]

Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon closed pull request #69214: branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH
URL: https://github.com/apache/doris/pull/69214


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] branch-4.1: [fix](be) Resolve VARIANT sub-column statistics for scored SEARCH [doris]

Posted by "eldenmoon (via GitHub)" <gi...@apache.org>.
eldenmoon commented on PR #69214:
URL: https://github.com/apache/doris/pull/69214#issuecomment-6235092863

   run buildall


-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org