Repository navigation
test: expand GoJieba fulltext BVT coverage - #25897
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
One non-blocking BVT determinism issue found. Tokenizer unit tests pass; broader tests were blocked by missing local C headers.
P2 - Order exact tokenizer results explicitly (test/distributed/cases/fulltext/gojieba_precise.sql:10)
The six select f.pos, f.word queries assert a specific row sequence, including __DocLen last, but have no ORDER BY. SQL does not guarantee table-function result order, so plan or distributed-execution changes can make this BVT flaky without changing tokenization. Add ORDER BY f.pos to each exact-token query.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
Follow-up review of head 1161938. Prior review surface: my 2026-07-20 review raised one P2 (non-blocking) finding — the six select f.pos, f.word tokenizer queries in gojieba_precise.sql asserted row order without ORDER BY. That is FIXED in e7b963e: all six queries now end with order by f.word = '__DocLen', f.pos, which is deterministic and correctly pins __DocLen last (its pos is the token count — e.g. 'red red red' emits DocLen pos=3, which a plain ORDER BY f.pos would interleave between tokens at 0/4/8, so the author's variant is more robust than the suggested fix). No other prior blockers exist. The four merge commits since the previously reviewed head (cd677ca, 306f2c8, cfb3b2e, 1161938) all have empty remerge-diffs (clean merges); upstream changes arriving through them (e.g. fulltext.result score updates, prepared-statement fulltext cases) are not authored by this PR and were excluded. The entire PR surface vs merge-base is 4 new files (gojieba_precise.sql/.result, fulltext_query_shapes.sql/.result, 515 insertions, test-only). I verified every precise assertion against the implementation: byte-offset positions (Pos=BytePos, pkg/sql/colexec/table_function/fulltext_tokenize.go:194), __DocLen.pos = token count emitted only when tokens exist (fulltext_tokenize.go:272-273), 23-byte cap with UTF-8-safe truncation and lower-casing (pkg/monlp/tokenizer/jieba.go), HMM disabled on the SQL path (SharedJiebaTokenizer(false)) matching the 他/来到/了/网易/杭/研/大厦 segmentation, single-newline multi-column join with NULL-column skip (fulltext_tokenize.go:148) supporting both the multi-column token offsets and the phrase-boundary negative (phrase matching is byte-position based, so the boundary byte breaks adjacency). The two expected-value corrections in e7b963e (+nullbodytoken → id 4; +lifecyclebody after title→NULL → id 6) match both the documented intent in the SQL comments and the index-build semantics. @SortKey:0 is a valid mo-tester flag used elsewhere in the suite. The @bvt:issue#25890 tag is valid (issue open). One new non-blocking finding: the @bvt:issue#25891 tag is stale because #25891 was fixed and the fix is already in this branch's HEAD. No other reviewer findings exist to dedupe against (PR history contains only my prior review and no inline comments).
non-blocking - Stale @bvt:issue#25891 tag: the IN-subquery MATCH shape is already fixed and never executed (test/distributed/cases/fulltext/fulltext_query_shapes.sql:70)
The block at lines 69-78 keeps select id from articles where id in (select id from articles where match(title, content) against('+database' in boolean mode)) order by id tagged with @bvt:issue#25891, but issue #25891 ('MATCH in an IN subquery is not rewritten to fulltext_index_scan') was closed as completed on 2026-08-20, and its fix commit 7108f9a (#26965, 'fix(plan): rewrite fulltext match in IN subqueries', merged 2026-08-11) is an ancestor of this PR's HEAD (the branch last merged main 428ce80 on 2026-08-26; git merge-base --is-ancestor 7108f9ab5a HEAD succeeds). mo-tester does not execute statements inside @bvt:issue blocks at all (mo-tester COMMON.java: 'bvt:issue tag will be not executed'), so this block contributes zero coverage and would silently miss a future regression of a shape the PR claims to cover. Additionally, #26965 already added test/distributed/cases/fulltext/fulltext_subquery.sql, which actively asserts this exact shape (same fixture data) with positive output and no issue tag, so the block here is also redundant. The PR's own comment ('remove the tags and add positive output after optimizer support lands') is already actionable at HEAD, and the PR description's 'retain unsupported query shapes as standard issue-tagged expected failures' no longer describes this shape. Suggested fix: delete the tagged block (covered by fulltext_subquery.sql) or drop the tags and assert the positive output (ids 1, 3, 4). Non-blocking: test-only change, no runtime impact, and the shape remains covered elsewhere.
|
Addressed the stale issue-tag feedback in
Validation:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of exact head 46ece64: one blocking test-quality issue.
P2 (blocking) — remove the newly skipped #25890 case in test/distributed/cases/fulltext/fulltext_query_shapes.sql:61-67 and its placeholder result.
The exact-head PROXY BVT log proves this file ran 14 statements with 13 successful and 1 ignored. The ignored statement is precisely this new @bvt:issue block: with the normal -g mode, mo-tester does not execute it at all. Therefore it adds no regression oracle, cannot verify the current failure mode, and will not tell us when the behavior starts working. Issue #25890 already contains the deterministic reproduction and explicitly asks for an active regression when the optimizer is fixed.
Please remove this skipped block and placeholder from this coverage PR, then add an executable positive assertion in the fix PR for #25890. New behavioral coverage should not be delivered as permanently ignored SQL.
I reviewed all four added files and traced the active assertions to the tokenizer/index implementation. The remaining 51 executed assertions are deterministic and consistent with current semantics; exact-head CI selected both new files and passed them (fulltext_query_shapes: 13/13 executed, 1 ignored; gojieba_precise: 38/38), with about 0.84s combined runtime. I found no other blocker.
aptend
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head 46ece64343caf35d2e84abb87eacaba7e51c8984 and the complete four-file diff from merge-base b0ae66c04d9a67175d2dfb8bf1c777fb888e1430, including all review history and the latest incremental fix.
The earlier determinism concern is closed by ordering DocLen last and tokens by byte position. The stale #25891 issue-tagged block is now removed; that exact IN-subquery shape remains actively covered by fulltext_subquery.sql. The remaining #25890 block corresponds to the still-open DISTINCT + ORDER BY rewrite bug and is correctly the sole expected skip. I checked the precise assertions against the tokenizer/table-function contracts: UTF-8 byte positions, lowercase/punctuation handling, UTF-8-safe 23-byte cap, dictionary-only HMM-disabled segmentation, per-token DocLen, nullable content handling, and the newline boundary between indexed columns all align.
Exact-head CI directly executed both new BVTs: gojieba_precise.sql passed 38/38 with no skips, while fulltext_query_shapes.sql passed 13 active statements with only the #25890 block skipped. Local validation also passed mo-tester SQL/result contract checking, git diff --check, focused FullText/Jieba tests for tokenizer, table-function, and planner packages, plus race-enabled Jieba and FullTextTokenize tests. I found no blocking issue.
|
Addressed the requested change in
Validation:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep-reviewed exact head f5a9718 against base b0ae66c and the complete four-file BVT diff plus review history. The prior blocker is closed: both newly skipped issue blocks are gone, so every retained case is active coverage. Verified the expected GoJieba contracts for UTF-8 byte offsets, DocLen, lowercase/punctuation handling, UTF-8-safe 23-byte truncation, HMM-disabled segmentation, multi-column newline boundaries, NULL/empty indexed values, duplicate/cross-document negatives, non-indexed updates, and truncate/reinsert lifecycle. Query-shape results are deterministic via explicit ordering or valid sort keys; fixtures are minimal, self-contained, sleep-free, and cleaned up. Exact-head CI is green and prior exact selection evidence directly exercised both files. No blocking test-quality, correctness, isolation, or runtime-cost issue remains.
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 14 seconds in the queue, including 1 second running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Issue: #25896
QA required: yes
What this PR does / why we need it:
add bvt case for gojieba