Michael-J-Ward commented on code in PR #880:
URL: https://github.com/apache/datafusion-python/pull/880#discussion_r1777685386
##########
python/datafusion/udf.py:
##########
@@ -246,3 +246,229 @@ def udaf(
state_type=state_type,
volatility=volatility,
)
+
+
+class WindowEvaluator(metaclass=ABCMeta):
+ """Evaluator class for user defined window functions (UDWF).
+
+ It is up to the user to decide which evaluate function is appropriate.
+
+
|``uses_window_frame``|``supports_bounded_execution``|``include_rank``|function_to_implement|
+ |---|---|----|----|
+ |False (default) |False (default) |False (default) |
``evaluate_all`` |
+ |False |True |False |
``evaluate`` |
+ |False |True/False |True |
``evaluate_all_with_rank`` |
+ |True |True/False |True/False |
``evaluate`` |
+ """ # noqa: W505
+
+ def memoize(self) -> None:
+ """Perform a memoize operation to improve performance.
+
+ When the window frame has a fixed beginning (e.g UNBOUNDED
Review Comment:
Q for my own understanding:
Should this be "When the window frame has a fixed **bound** (beginning or
end)..."?
I ask because the docs use `last_value` as an example, and I don't see how
`last_value` could benefit from `memoize` because of a fixed **beginning**.
(If I'm correct, I'll go fix the docs upstream)
https://docs.rs/datafusion/latest/datafusion/logical_expr/trait.PartitionEvaluator.html#method.memoize
--
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]