Skip to content

[fix](regression) Pin the VARIANT subcolumn limit in test_match_keyword_score - #70151

Merged
eldenmoon merged 1 commit into
apache:masterfrom
airborne12:fix-match-keyword-score-flaky
Nov 4, 2026
Merged

eldenmoon merged 1 commit into
apache:masterfrom
airborne12:fix-match-keyword-score-flaky

Conversation

@airborne12

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: None

Related PR: #69790

Problem Summary: inverted_index_p0/test_match_keyword_score, added by #69790, has
failed in P0 since it merged, always on the VARIANT part of the first loop pass:

Check tag 'V2_variant_sparse_path' failed, line 1, DOUBLE result mismatch.
Expect cell is: 0.980829
But real is   : 0

(once in cloud_p0: V2_variant_text_path, 0.693147 vs 0).

The suite expects every VARIANT path (n, s, p) to be a materialized subcolumn
with its own inverted index. CI runs with use_fuzzy_session_variable, and
SessionVariable.initFuzzyModeVariables sets default_variant_max_subcolumns_count
to random.nextInt(10) on each new connection (0 when it picks doc mode). The suite
already pinned default_variant_enable_typed_paths_to_sparse and
default_variant_enable_doc_mode, but not this limit. With a limit of 1, the
writer keeps only the top path of each segment (s, by the path tie-break) and
moves n and p to the sparse column. The sparse column has no inverted index, so
MATCH on those paths runs without the index and scores 0.

The numeric path loses its score as well (row 4: 0.287682 -> 0), but
OutputUtils accepts that mismatch: when the cells have different numbers of
decimal places, it rounds 0.287682 to "0" places, which gives 0. So the suite
fails only at the sparse path, whose score is 0.98.

Reproduced on a local cluster: with SET GLOBAL default_variant_max_subcolumns_count = 1,
the unchanged suite fails with exactly the CI message. Limits 0 and 2-9 pass.

Fix: set default_variant_max_subcolumns_count = 0 (no limit) next to the other
two pinned VARIANT defaults. The expected output does not change.

Release note

None

Check List (For Author)

  • Test: Regression test
    • test_match_keyword_score on a local cluster: before the fix it fails with the
      CI message under a forced limit of 1; after the fix it passes under that
      limit and with the default.
  • Behavior changed: No
  • Does this need documentation: No

🤖 Generated with Claude Code

…rd_score

### What problem does this PR solve?

Issue Number: None

Related PR: apache#69790

Problem Summary: inverted_index_p0/test_match_keyword_score, added by apache#69790, has
failed in P0 since it merged, always on the VARIANT part of the first loop pass:

    Check tag 'V2_variant_sparse_path' failed, line 1, DOUBLE result mismatch.
    Expect cell is: 0.980829
    But real is   : 0

(once in cloud_p0: V2_variant_text_path, 0.693147 vs 0).

The suite expects every VARIANT path (n, s, p) to be a materialized subcolumn
with its own inverted index. CI runs with use_fuzzy_session_variable, and
SessionVariable.initFuzzyModeVariables sets default_variant_max_subcolumns_count
to random.nextInt(10) on each new connection (0 when it picks doc mode). The suite
already pinned default_variant_enable_typed_paths_to_sparse and
default_variant_enable_doc_mode, but not this limit. With a limit of 1, the
writer keeps only the top path of each segment (s, by the path tie-break) and
moves n and p to the sparse column. The sparse column has no inverted index, so
MATCH on those paths runs without the index and scores 0.

The numeric path loses its score as well (row 4: 0.287682 -> 0), but
OutputUtils accepts that mismatch: when the cells have different numbers of
decimal places, it rounds 0.287682 to "0" places, which gives 0. So the suite
fails only at the sparse path, whose score is 0.98.

Reproduced on a local cluster: with SET GLOBAL default_variant_max_subcolumns_count = 1,
the unchanged suite fails with exactly the CI message. Limits 0 and 2-9 pass.

Fix: set default_variant_max_subcolumns_count = 0 (no limit) next to the other
two pinned VARIANT defaults. The expected output does not change.

### Release note

None

### Check List (For Author)

- Test: Regression test
    - test_match_keyword_score on a local cluster: before the fix it fails with the
      CI message under a forced limit of 1; after the fix it passes under that
      limit and with the default.
- Behavior changed: No
- Does this need documentation: No

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

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?

@airborne12

Copy link
Copy Markdown
Member Author

run buildall

@airborne12

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41762223816

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@airborne12

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Selected model is at capacity. Please try a different model.
Workflow run: https://github.com/apache/doris/actions/runs/41780726085

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@airborne12

Copy link
Copy Markdown
Member Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings in the complete one-file diff at head 6fd346a. The added session SET pins the VARIANT extraction limit before each CREATE TABLE, preserving indexed n/s/p paths and the intended score expectations under fuzzy session defaults.

Critical checkpoint conclusions:

  1. Goal/correctness: the session default is read during VARIANT type creation; zero retains all dynamic paths in the writer. The existing regression checks the resulting indexed scores; runtime reproduction was not performed for this review.
  2. Scope/reuse: one existing SET and its explanatory comment, beside the existing VARIANT pins, are focused and sufficient.
  3. Concurrency/locks: no concurrent work or locks added; the SET is session scoped on the suite's reused connection.
  4. Lifecycle/static initialization: connection cleanup contains the setting within the suite; no new resource ownership or static initialization.
  5. Configuration: an existing dynamically settable default is pinned; no new configuration or restart requirement.
  6. Compatibility: no symbols, storage formats, or upgrade behavior changed.
  7. Thrift/protobuf: no definition changes; cross-branch field-id checks are inapplicable.
  8. Parallel paths: the common V2/V3/SNII loop applies the pin to every VARIANT fixture; the inspected metadata/writer path does not introduce a cloud-specific exception.
  9. Conditions: no new branch; the comment explains the indexed-subcolumn prerequisite and unlimited value.
  10. Tests: existing ordered regression checks retain MATCH/SEARCH, numeric/text/missing-segment VARIANT paths, and cached BKD coverage for all three formats. No new kernel feature or negative path is added.
  11. Expected results: unchanged; the fix restores fixture materialization rather than changing expected scores.
  12. Observability/errors: existing SQL logging and exception propagation suffice; no new runtime path needs metrics.
  13. Transactions/persistence: no EditLog, replay, failover, or persistence logic changed.
  14. Writes/atomicity: existing fixture writes are preserved; production transaction and crash behavior are unchanged.
  15. FE/BE variables: no new variable or wire field; the existing setting is forwarded and carried through column metadata.
  16. Performance/memory: unlimited extraction is bounded to this four-row, three-path fixture; no production hot path changes.
  17. Other/core invariants: no introduced visibility, version, delete-bitmap, memory-ownership, or silent-error issue found.

User focus: none supplied. Existing inline findings: none. The pre-existing floating-point comparison behavior described in the PR is unchanged and is not a finding against this patch.

Coverage: complete static review of the supplied diff, suite and expected output, session/fuzz lifecycle, CREATE-time defaults, metadata propagation, and writer selection, with separate general and risk-focused reviews. No unresolved static coverage questions. No builds, tests, benchmarks, source changes, or runtime validation were performed.

Review converged after 1 round(s).

@eldenmoon eldenmoon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eldenmoon
eldenmoon merged commit 380912c into apache:master Nov 4, 2026
37 checks passed
@airborne12
airborne12 deleted the fix-match-keyword-score-flaky branch November 4, 2026 10:57
airborne12 added a commit to airborne12/apache-doris that referenced this pull request Nov 25, 2026
Keep both test compile definitions in be/test/CMakeLists.txt: the Kuromoji
dictionary path from apache#70555 and the SNII golden corpus path from apache#68607.

Use the debug_variant_* session variables in test_match_keyword_score, since
apache#70609 renamed default_variant_*. Keep the subcolumn limit pin from apache#70151.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants