Skip to content

Add tests for BatchCoalescer::push_batch_with_filter, fix bug #7774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2025

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jun 25, 2025

Which issue does this PR close?

Rationale for this change

As part of #7762 I want to optimize applying filters by adding a new code path.

To ensure that works well, let's ensure the filtered code path is well covered with tests

What changes are included in this PR?

  1. Add tests for filtering batches with 0.01%, 1%, 10% and 90% and varying data types

Are these changes tested?

Only tests, no functional changes

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 25, 2025
@alamb alamb force-pushed the alamb/tests_for_push_filtered branch from 60beecd to 65604c5 Compare June 25, 2025 14:33
@alamb alamb marked this pull request as ready for review June 25, 2025 14:33
@@ -456,6 +460,98 @@ mod tests {
.run();
}

/// Coalesce multiple batches, 80k rows, with a 0.1% selectivity filter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is to get filter coverage prior to writing some specialized code for it

@alamb alamb changed the title Add tests for BatchCoalescer::push_batch_with_filter Add tests for BatchCoalescer::push_batch_with_filter, fix bug Jul 10, 2025
use std::fmt::Debug;
use std::sync::Arc;

/// InProgressArray for [`PrimitiveArray`]
#[derive(Debug)]
pub(crate) struct InProgressPrimitiveArray<T: ArrowPrimitiveType> {
/// Data type of the array
data_type: DataType,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

previously primitive arrays like TimestampNanosecond would lose the timezone information. This fixes the issue

@mbrobbel
Copy link
Member

Opened apache/arrow-js#205 for the failing test (passed after retry).

@alamb
Copy link
Contributor Author

alamb commented Jul 14, 2025

Thank you @mbrobbel

@alamb alamb merged commit 03a837e into apache:main Jul 16, 2025
25 of 26 checks passed
@alamb
Copy link
Contributor Author

alamb commented Jul 16, 2025

Thanks agin @mbrobbel

@alamb alamb deleted the alamb/tests_for_push_filtered branch July 16, 2025 20:08
klion26 added a commit to klion26/arrow-rs that referenced this pull request Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants