Skip to content

[Bug]: sampled ANALYZE output breaks window_hash_partition BVT expectation #28171

Closed

Description

@gouhongshen

Existing issue check

  • I searched open MatrixOne issues for window_hash_partition, analyze table t(k, ck), and sampled statistics; no matching report exists.

Branch and commit

Environment

GitHub Actions Ubuntu/x64, Compose multi-CN, pessimistic BVT: run 33902137569, job 101120817646.

Actual behavior

test/distributed/cases/window/window_hash_partition.sql fails at ANALYZE TABLE t(k, ck). The statement succeeds, but its result contract changed to the sampled-statistics status row:

table_name | mode | coverage | columns_analyzed | population_rows | population_exact | sample_rows | sample_blocks | sample_bytes | status | message
window_hash_partition.t | AUTO | SNAPSHOT_VISIBLE_V1 | 2 | 10000 | 1 | 10000 | 3 | 760000 | OK | q=1/1

The corresponding .result still expects the legacy two-column approx_count_distinct(k) / approx_count_distinct(ck) result (50 | 50), so the BVT fails despite successful analysis. The sampled-statistics commit updated ANALYZE cases but did not update this window case.

Expected behavior

The window BVT expectation must match the supported ANALYZE TABLE result contract after sampled-statistics rollout, with the test retaining its intended partition coverage.

Reproduction

create database window_hash_partition;
use window_hash_partition;
create table t (id int primary key, k int, ck char(3), v int);
insert into t select result, result % 50, cast(result % 50 as char(3)), result from generate_series(1, 10000) g;
analyze table t(k, ck);

Compare the result with test/distributed/cases/window/window_hash_partition.result.

Scope evidence

PR #28148 only changes Data Branch TRUNCATE lineage files and does not touch ANALYZE, statistics, planner/window execution, or this BVT case.

Activity

  1. self-assigned this
    on Sep 4, 2026
  2. added
    kind/bug
    severity/s0
    ai-easy
    and removed on Sep 4, 2026
  3. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    The same root cause reproduced independently on PR #28170: run 33902393045, pessimistic BVT job 101121886538.

    Evidence:

    The Coverage job in that run is a downstream failure: it received prerequisites_ready=false after this BVT producer failed.

  4. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Investigation confirmed this is an oracle-only regression from sampled ANALYZE output in e89cd75. The exact window_hash_partition case reproduced 14/15 before the change because ANALYZE returned 11 columns while the result expected 2; after updating the expected status row, it passed 15/15 twice on the same instance. Draft PR #28172 contains the one-file test update; no production code changed.

  5. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    PR #28172 is trying to fix this issue.

  6. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Additional CI evidence: workflow run 33902380103, attempt 1, ran at PR head a02d2d746354fca8f7d122f5903353ceeca724f3. Its compose multi-CN pessimistic BVT job 101122331742 failed only at window_hash_partition.sql row 18, analyze table t(k, ck);. The uploaded report shows the expected legacy two-column NDV result versus the actual 11-column sampled-ANALYZE status row; the statement itself returned OK. The separate Coverage job 101135303754 is downstream (prerequisites_ready=false) and is not an independent failure. This matches #28171 root cause and is unrelated to PR #28126, whose diff is limited to RESTORE TABLE foreign-key handling and tests.

  7. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Additional CI evidence from PR #28146: workflow run 33905761703, attempt 1, failed job 101133110911 in the Compose multi-CN Pessimistic BVT. The existing window_hash_partition.sql case again failed at row 18 (analyze table t(k, ck);): the fixture expected the legacy two-column approx_count_distinct(k) / approx_count_distinct(ck) result (50 | 50), while the successful statement returned the 11-column sampled-ANALYZE status row (... | OK | q=1/1). This is the same oracle-only regression already tracked here and is unrelated to PR #28146, whose changes are limited to database CLONE external-table handling.

  8. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Repeated CI evidence (no further retry): the one permitted failed-job rerun of workflow 33902137569 is attempt 2 and failed again at job 101132585685.

    The failing step is Start BVT Test; window_hash_partition.sql reports 14/15 successes and the only error SQL is ANALYZE TABLE t(k, ck). This reproduces the same legacy-result-versus-sampled-status-row mismatch reported in this issue. The associated coverage job 101143547735 again has prerequisites_ready: false and exits before merge because the BVT producer failed.

    PR #28148 still has no changes in the ANALYZE/statistics/window path. The workflow is already attempt 2, so it is intentionally not rerun again.

  9. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Repeated CI evidence: rerun attempt 2 of workflow run 33902380103 failed in the same compose multi-CN pessimistic BVT job 101138384061. Its uploaded report again shows window_hash_partition.sql row 18, analyze table t(k, ck);, with the expected two-column legacy NDV result and the actual 11-column sampled-ANALYZE status row (SNAPSHOT_VISIBLE_V1, OK). The BVT executed 14/15 successfully; no product error occurred. Coverage job 101147760479 again received prerequisites_ready=false and is only a downstream failure. The workflow attempt is now greater than 1, so no further rerun is permitted by the CI procedure. PR #28126 remains unrelated and unchanged.

  10. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Repeated CI evidence from PR #28170 (no further retry): workflow run 33902393045 is now attempt 2 and failed again in pessimistic BVT job 101141147731.

    The only failing case is window_hash_partition.sql row 18, analyze table t(k, ck);: 14/15 statements passed, with the same legacy 2-column expectation versus the actual 11-column sampled-ANALYZE status row. PR #28170s own replace_conflict_lookup.sql passed 24/24 in the same job, and the PR has no diff in the failing window fixture. Coverage job 101150866850 again received prerequisites_ready=false and is only downstream.

    This workflow is already attempt 2, so it is intentionally not rerun again.

  11. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    Repeated CI evidence from PR #28146 (no further retry): the permitted failed-job rerun of workflow 33905761703 is attempt 2 and failed again in job 101144209123. The only failing case remains window_hash_partition.sql row 18, analyze table t(k, ck);: the statement returned the 11-column sampled-ANALYZE status row, while the fixture expected the legacy two-column NDV result. The associated Coverage job 101153886640 received prerequisites_ready: false and is only a downstream failure. The workflow is already attempt 2, so no further rerun is permitted. PR #28146 has no changes in the ANALYZE/statistics/window path.

  12. gouhongshen commented on Sep 4, 2026

    @gouhongshen
    ContributorAuthor

    PR #28172 has merged and is awaiting manual validation. The issue remains open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions