Skip to content

[test](regression) Make map_agg NULL-key assertions order-independent - #69446

Merged
yiguolei merged 1 commit into
apache:branch-4.2from
mrhhsg:fix/map-agg-null-key-regression-42
Oct 23, 2026
Merged

yiguolei merged 1 commit into
apache:branch-4.2from
mrhhsg:fix/map-agg-null-key-regression-42

Conversation

@mrhhsg

@mrhhsg mrhhsg commented Oct 22, 2026

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: None

The agg_sync_mv regression expected a map without a valid NULL key and compared the string representation of map_agg results, which can vary with map entry order.

What changed?

  • Keep the existing input and aggregation, but assert the map size, NULL-key presence, and values for NULL and ordinary keys through scalar expressions.
  • Update only the final expected-output block for the affected regression case. No product behavior changes.

Testing

  • ASAN BE/FE build with BE Java extensions and Maven Checkstyle validation: passed.
  • Minimal NULL-key scalar query: passed; confirmed two keys and both expected values.
  • agg_sync_mv P1 regression output regeneration (-forceGenOut) and runs without regeneration: passed. The final narrowed expected-output change passed the full suite (1 suite, 0 failures).
  • git diff --check origin/branch-4.2...HEAD for the two changed files: passed.

Release note

None

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: The aggregation regression expected the map for an integer group to omit a valid NULL key and compared the order-dependent string representation of map entries. Project the map size, NULL-key presence, and values for NULL and ordinary keys instead. Keep the existing data and aggregation behavior unchanged.

### Release note

None

### Check List (For Author)

- Test: Regression test
    - Built BE and FE on branch-4.2 with ASAN and BE Java extensions.
    - Regenerated the focused suite output and reran the suite against the narrow expected-output change.
    - Ran the minimal NULL-key scalar query and git diff --check.
- Behavior changed: No; regression assertions only.
- Does this need documentation: No
@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?

@mrhhsg

mrhhsg commented Oct 22, 2026

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.

Reviewed PR #69446 at commit 160d692. No actionable findings. The review converged in one round: the complete-scope reviewer and separate risk reviewer both returned NO_NEW_VALUABLE_FINDINGS on the unchanged empty inline set. Both changed files and the fixture -> load/duplication -> aggregation -> scalar projection -> ordered regression comparison path were reviewed. There were no existing inline threads and no additional user-provided focus points.

Critical checkpoint conclusions:

  1. Goal and behavior: the scalar assertions remove map entry-order dependence while retaining complete contents and NULL-key coverage for this fixture. SQL map_agg binds V2; aggregation, merging, membership and subscript preserve NULL-key semantics, including the FE constant-folding exception.
  2. Scope: focused change to one final query and its matching expected-output block; inputs, grouping, repeated inserts and preceding MV assertions remain unchanged.
  3. Concurrency and locks: no thread, shared-state or locking change. Every duplicate key carries the same value, so merge scheduling cannot change the assertions.
  4. Lifecycle and static initialization: no new resource ownership, callbacks or static/global state; existing test table setup and load lifecycle are preserved.
  5. Configuration: no new configuration; the existing pipeline task setting is retained.
  6. Compatibility: no symbol, storage or wire-format changes; scalar functions already exist on this head.
  7. Shared definitions: no Thrift/protobuf changes, so cross-release field/enum checks are not applicable.
  8. Parallel paths: reviewed p0 MV and map_agg/map_agg_v1 regression cases; no required companion change identified.
  9. Special conditions: no new conditional logic; explicit INT lookup casts match the map key type and fixture range.
  10. Test coverage: the updated assertions check cardinality, NULL-key presence/absence, stored values for every key, and missing-key NULL results. The duplicated-input workload and deterministic ORDER BY are preserved.
  11. Expected results: all 13 modified rows and 65 scalar cells independently match the fixture, including literal string "null" versus SQL NULL. The qt_test output tag is unchanged, and JDBC/CSV scalar formatting is consistent with the golden file.
  12. Observability: existing regression failure reporting includes SQL and actual output; no new product path requires logs or metrics.
  13. Transactions and persistence: no EditLog, replay, commit or failover behavior changed.
  14. Writes and atomicity: all existing load/insert statements are unchanged; no new mutation or crash behavior.
  15. FE/BE transmission: no new transmitted variables; existing function aliases, types and NULL handling agree for MAP<INT,STRING>.
  16. Performance: aggregation workload is preserved; added scalar work covers only 13 maps with at most two entries each.
  17. Other invariants: no introduced visibility, delete-bitmap, memory-ownership or error-handling issue established.

Validation limits: this was a static review. No builds, regression/unit tests, submodule initialization or repository source edits were performed. The PR description reports generated output and successful regression runs; those executions and generation provenance were not independently reproduced. No unresolved code candidates or uncovered changed-file scope remain.

Review converged after 1 round(s).

@mrhhsg

mrhhsg commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

run buildall

@mrhhsg
mrhhsg marked this pull request as ready for review October 23, 2026 03:40
@mrhhsg
mrhhsg requested a review from yiguolei as a code owner October 23, 2026 03:40
@yiguolei
yiguolei merged commit 756a670 into apache:branch-4.2 Oct 23, 2026
37 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

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

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants