Jefffrey commented on code in PR #19642: URL: https://github.com/apache/datafusion/pull/19642#discussion_r2660445083
########## datafusion/expr/src/udwf.rs: ########## @@ -236,69 +240,67 @@ where /// See [`advanced_udwf.rs`] for a full example with complete implementation and /// [`WindowUDF`] for other available options. /// -/// /// [`advanced_udwf.rs`]: https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/udf/advanced_udwf.rs /// # Basic Example /// ``` /// # use std::any::Any; -/// # use std::sync::LazyLock; /// # use arrow::datatypes::{DataType, Field, FieldRef}; -/// # use datafusion_common::{DataFusionError, plan_err, Result}; -/// # use datafusion_expr::{col, Signature, Volatility, PartitionEvaluator, WindowFrame, ExprFunctionExt, Documentation, LimitEffect}; -/// # use datafusion_expr::{WindowUDFImpl, WindowUDF}; +/// # use datafusion_common::Result; +/// # use datafusion_expr::{col, Signature, Volatility, PartitionEvaluator, WindowFrame, ExprFunctionExt, Documentation, WindowUDFImpl, WindowUDF}; /// # use datafusion_functions_window_common::field::WindowUDFFieldArgs; /// # use datafusion_functions_window_common::partition::PartitionEvaluatorArgs; -/// # use datafusion_expr::window_doc_sections::DOC_SECTION_ANALYTICAL; -/// # use datafusion_physical_expr_common::physical_expr; +/// # use datafusion_macros::user_doc; /// # use std::sync::Arc; -/// +/// #[user_doc( Review Comment: This requires pulling in `datafusion-macros` as a dev dependency, but to me it is more representative of how you would implement a UDWF ########## datafusion/expr/src/udwf.rs: ########## @@ -427,21 +440,130 @@ pub trait WindowUDFImpl: Debug + DynEq + DynHash + Send + Sync { None } - /// If not causal, returns the effect this function will have on the window + /// Returns the effect this function has on limit pushdowns. See [`LimitEffect`] + /// for more details. + /// + /// Defaults to [`LimitEffect::Unknown`]. fn limit_effect(&self, _args: &[Arc<dyn PhysicalExpr>]) -> LimitEffect { LimitEffect::Unknown } } -/// the effect this function will have on the limit pushdown +/// The effect this function will have on limit pushdowns through a window bound. Review Comment: @avantgardnerio would you be able to double check the documentation here since you worked on the original implementation? -- 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]
