This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 9781aef1b0 Remove deprecated WindowUDF::new (#12507)
9781aef1b0 is described below
commit 9781aef1b0494520fea13f51bd5bea7a93b6380a
Author: Piotr Findeisen <[email protected]>
AuthorDate: Wed Sep 18 13:56:29 2024 +0200
Remove deprecated WindowUDF::new (#12507)
Deprecated since v 34. Remove it along with associated
`WindowUDFLegacyWrapper`.
---
datafusion/expr/src/udwf.rs | 71 +--------------------------------------------
1 file changed, 1 insertion(+), 70 deletions(-)
diff --git a/datafusion/expr/src/udwf.rs b/datafusion/expr/src/udwf.rs
index b24aaf8561..fc4432ffdf 100644
--- a/datafusion/expr/src/udwf.rs
+++ b/datafusion/expr/src/udwf.rs
@@ -31,8 +31,7 @@ use datafusion_common::{not_impl_err, Result};
use crate::expr::WindowFunction;
use crate::{
- function::WindowFunctionSimplification, Expr, PartitionEvaluator,
- PartitionEvaluatorFactory, ReturnTypeFunction, Signature,
+ function::WindowFunctionSimplification, Expr, PartitionEvaluator,
Signature,
};
/// Logical representation of a user-defined window function (UDWF)
@@ -81,25 +80,6 @@ impl Hash for WindowUDF {
}
impl WindowUDF {
- /// Create a new WindowUDF from low level details.
- ///
- /// See [`WindowUDFImpl`] for a more convenient way to create a
- /// `WindowUDF` using trait objects
- #[deprecated(since = "34.0.0", note = "please implement WindowUDFImpl
instead")]
- pub fn new(
- name: &str,
- signature: &Signature,
- return_type: &ReturnTypeFunction,
- partition_evaluator_factory: &PartitionEvaluatorFactory,
- ) -> Self {
- Self::new_from_impl(WindowUDFLegacyWrapper {
- name: name.to_owned(),
- signature: signature.clone(),
- return_type: Arc::clone(return_type),
- partition_evaluator_factory:
Arc::clone(partition_evaluator_factory),
- })
- }
-
/// Create a new `WindowUDF` from a `[WindowUDFImpl]` trait object
///
/// Note this is the same as using the `From` impl (`WindowUDF::from`)
@@ -478,55 +458,6 @@ impl WindowUDFImpl for AliasedWindowUDFImpl {
}
}
-/// Implementation of [`WindowUDFImpl`] that wraps the function style pointers
-/// of the older API (see <https://github.com/apache/datafusion/pull/8719>
-/// for more details)
-pub struct WindowUDFLegacyWrapper {
- /// name
- name: String,
- /// signature
- signature: Signature,
- /// Return type
- return_type: ReturnTypeFunction,
- /// Return the partition evaluator
- partition_evaluator_factory: PartitionEvaluatorFactory,
-}
-
-impl Debug for WindowUDFLegacyWrapper {
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
- f.debug_struct("WindowUDF")
- .field("name", &self.name)
- .field("signature", &self.signature)
- .field("return_type", &"<func>")
- .field("partition_evaluator_factory", &"<func>")
- .finish_non_exhaustive()
- }
-}
-
-impl WindowUDFImpl for WindowUDFLegacyWrapper {
- fn as_any(&self) -> &dyn Any {
- self
- }
-
- fn name(&self) -> &str {
- &self.name
- }
-
- fn signature(&self) -> &Signature {
- &self.signature
- }
-
- fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
- // Old API returns an Arc of the datatype for some reason
- let res = (self.return_type)(arg_types)?;
- Ok(res.as_ref().clone())
- }
-
- fn partition_evaluator(&self) -> Result<Box<dyn PartitionEvaluator>> {
- (self.partition_evaluator_factory)()
- }
-}
-
#[cfg(test)]
mod test {
use crate::{PartitionEvaluator, WindowUDF, WindowUDFImpl};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]