Skip to content

refactor(query): improve aggregate bitmap and aggregate function state#19707

Open
zhang2014 wants to merge 4 commits intodatabendlabs:mainfrom
zhang2014:refactor/aggregate-bitmap
Open

refactor(query): improve aggregate bitmap and aggregate function state#19707
zhang2014 wants to merge 4 commits intodatabendlabs:mainfrom
zhang2014:refactor/aggregate-bitmap

Conversation

@zhang2014
Copy link
Copy Markdown
Member

@zhang2014 zhang2014 commented Apr 13, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

refactor(query): improve aggregate bitmap and aggregate function state

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Apr 13, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89f6a99245

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +311 to +315
if let Some(existing) = state.rb.take() {
bitmaps.push(existing);
}
if let Some(validity) = validity {
if validity.null_count() == view.len() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve state when batch input has no valid bitmaps

The new batch path removes the current aggregate value with state.rb.take() before checking whether the entire chunk is null, and then exits early on validity.null_count() == view.len(). In multi-block aggregation, an all-null later block will therefore erase the bitmap accumulated from earlier blocks, yielding an incorrect final bitmap_or result. Make the all-null check happen before taking state.rb (or restore it before returning) so null-only chunks remain no-ops.

Useful? React with 👍 / 👎.

@zhang2014 zhang2014 added the ci-cloud Build docker image for cloud test label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-19707-30fda0d-1776099619

note: this image tag is only available for internal use.

@zhang2014 zhang2014 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-19707-8e39099-1776234238

note: this image tag is only available for internal use.

@zhang2014 zhang2014 added ci-cloud Build docker image for cloud test and removed ci-cloud Build docker image for cloud test labels Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Docker Image for PR

  • tag: pr-19707-0639880-1776261113

note: this image tag is only available for internal use.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 CI Job Analysis

Workflow: 24455104139

📊 Summary

  • Total Jobs: 87
  • Failed Jobs: 1
  • Retryable: 0
  • Code Issues: 1

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / test_private_tasks: Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

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

Labels

ci-cloud Build docker image for cloud test pr-refactor this PR changes the code base without new features or bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant