zclllyybb commented on issue #64178: URL: https://github.com/apache/doris/issues/64178#issuecomment-4641950708
Breakwater-GitHub-Analysis-Slot: slot_3cf08be316c5 Initial analysis: this matches a known view + lazy/two-phase materialization metadata bug in 4.1.0, rather than a scoring calculation problem in `MATCH_ANY` / `score()` itself. Evidence from the 4.1.0 code path: - In 4.1.0, `LogicalView.computeOutput()` qualifies view outputs through `SlotReference.withOneLevelTableAndColumnAndQualifier(...)`. - In that version, `withOneLevelTableAndColumnAndQualifier(...)` overwrites the slot's `originalColumn` with the view schema column. That loses the base-table column metadata / `colUniqueId` needed when Doris later fetches delayed columns. - `score()` is pushed as a virtual scan column for the `ORDER BY score() LIMIT` path, so the score value can still be produced from the full-text match. The projected columns such as `hotel_id` and `hotel_name` can be fetched later by the lazy/two-phase materialization path; over a view on 4.1.0, that path can no longer resolve the real base columns correctly, which explains why the score is present while the other projected values are empty. This specific metadata issue was fixed by apache/doris#62533 and backported to `branch-4.1` by apache/doris#62573. The fix preserves the base `originalColumn` and only changes the one-level/view column metadata. Local 4.1 tags containing that backport start at `4.1.1`, while the `4.1.0` tag still has the old behavior. Recommended next steps: 1. Please retry the same query on Doris `4.1.1` or a newer 4.1 build. If it no longer reproduces, this issue can be closed as already fixed by #62533 / #62573. 2. If you must stay on `4.1.0`, the safest workaround is the one you already found: run the text-search `score()` stage against the base table with the same structured predicates instead of through the view. Another workaround is to disable the TopN/two-phase/lazy materialization optimization for this query if the performance tradeoff is acceptable. 3. If it still reproduces on `4.1.1+`, please attach `SHOW CREATE TABLE hotels`, `SHOW CREATE VIEW hotel_candidates`, `EXPLAIN VERBOSE` for both the view query and the equivalent base-table query, the exact Doris build hash, and the values of `enable_two_phase_read_opt`, `topn_opt_limit_threshold`, `topn_lazy_materialization_threshold`, and `topn_lazy_materialization_using_index`. -- 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]
