Skip to content

Commit

Permalink
Fix commented test case
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafasrepo committed Mar 11, 2024
1 parent 9c788b0 commit ecf8d44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion datafusion/physical-expr/src/window/nth_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ impl PartitionEvaluator for NthValueEvaluator {
}
}
};
if is_prunable {
// Do not memoize results when nulls are ignored.
if is_prunable && !self.ignore_nulls {
if self.state.finalized_result.is_none() && !is_reverse_direction {
let result = ScalarValue::try_from_array(out, size - 1)?;
self.state.finalized_result = Some(result);
Expand Down
18 changes: 9 additions & 9 deletions datafusion/sqllogictest/test_files/window.slt
Original file line number Diff line number Diff line change
Expand Up @@ -4486,15 +4486,15 @@ SELECT LAST_VALUE(column1) OVER(ORDER BY column2 DESC NULLS LAST), column2 FROM
NULL 2
NULL 1

# query II
# SELECT LAST_VALUE(column1) IGNORE NULLS OVER(ORDER BY column2 DESC NULLS LAST), column2 FROM t;
# ----
# 6 6
# 5 5
# 3 4
# 4 3
# 4 2
# 4 1
query II
SELECT LAST_VALUE(column1) IGNORE NULLS OVER(ORDER BY column2 DESC NULLS LAST), column2 FROM t;
----
6 6
5 5
3 4
4 3
4 2
4 1

query II
SELECT LAST_VALUE(column1) OVER(ORDER BY column2 DESC NULLS LAST ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING), column2 FROM t;
Expand Down

0 comments on commit ecf8d44

Please sign in to comment.