Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,11 @@ impl ExecutionPlan for BoundedWindowAggExec {
fn required_input_ordering(&self) -> Vec<Option<LexRequirement>> {
let partition_bys = self.window_expr()[0].partition_by();
let order_keys = self.window_expr()[0].order_by();
if self.input_order_mode != InputOrderMode::Sorted
|| self.ordered_partition_by_indices.len() >= partition_bys.len()
{
let partition_bys = self
.ordered_partition_by_indices
.iter()
.map(|idx| &partition_bys[*idx]);
vec![calc_requirements(partition_bys, order_keys)]
} else {
vec![calc_requirements(partition_bys, order_keys)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when self.input_order_mode is InputOrderMode::Sorted, it is guaranteed that self.ordered_partition_by_indices.len() == partition_bys.len(). Hence, else branch was never being triggerred in the previous version. I think, that check is redundant.

}
let partition_bys = self
.ordered_partition_by_indices
.iter()
.map(|idx| &partition_bys[*idx]);
vec![calc_requirements(partition_bys, order_keys)]
}

fn required_input_distribution(&self) -> Vec<Distribution> {
Expand Down