Skip to content
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

Ignore null LEAD support for small batch sizes. #9445

Merged
merged 8 commits into from
Mar 4, 2024

Conversation

mustafasrepo
Copy link
Contributor

@mustafasrepo mustafasrepo commented Mar 4, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

This PR is a subsequent work of the PR9419 by @comphead .

What changes are included in this PR?

This PR adds support for ignore nulls mode for lead function. When data is received in small batches.

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Mar 4, 2024
# Conflicts:
#	datafusion/physical-expr/src/window/lead_lag.rs
@mustafasrepo mustafasrepo requested a review from comphead March 4, 2024 06:47
let end = if self.non_null_offsets.len() == (-self.shift_offset) as usize {
// How many rows needed further than the current row to get necessary lead result
let offset: usize = self.non_null_offsets.iter().sum();
min(idx + offset + 1, n_rows)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

lgtm thanks @mustafasrepo

@comphead
Copy link
Contributor

comphead commented Mar 4, 2024

I plan to merge it as its a good fix

@comphead comphead merged commit 1e8fa2f into apache:main Mar 4, 2024
24 checks passed
wiedld pushed a commit to wiedld/arrow-datafusion that referenced this pull request Mar 21, 2024
* IGNORE NULLS support for LEAD

* fix

* fix

* fix

* Add lead support when pruned

* Update lead_lag.rs

Minor changes

* Fix formatting

---------

Co-authored-by: comphead <[email protected]>
Co-authored-by: Mustafa Akur <[email protected]>
@mustafasrepo mustafasrepo deleted the feature/lead_pruned branch March 27, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants