mzabaluev opened a new pull request, #19496: URL: https://github.com/apache/datafusion/pull/19496
## Rationale for this change The `PartitionEvaluator` implementation for `NthValue` in DataFusion has a few shortcomings: * When nulls are ignored (meaning the count should skip over them), the evaluation collects an array of all valid indices, to select at most one index accordingly to the `First`/`Last`/`Nth` case. * The `memoize` implementation gives up in the same condition, even after performing part of the logic! ## What changes are included in this PR? Use only as much iteration over the valid indices as needed for the function case, without collecting all indices. The `memoize` implementation does the right thing for `FirstValue` with `ignore_nulls` set to true, or returns early for other function cases. ## Are these changes tested? All existing tests pass for `FirstValue`/`LastValue`/`NthValue`. ## Are there any user-facing changes? No. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
