Skip to content

Ignore null LEAD support for small batch sizes.#9445

Merged
comphead merged 8 commits intoapache:mainfrom
synnada-ai:feature/lead_pruned
Mar 4, 2024
Merged

Ignore null LEAD support for small batch sizes.#9445
comphead merged 8 commits intoapache:mainfrom
synnada-ai:feature/lead_pruned

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 Changes to the physical-expr crates 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
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 <comphead@ukr.net>
Co-authored-by: Mustafa Akur <akurmustafa@gmail.com>
@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 Changes to the physical-expr crates sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants