Skip to content

Commit

Permalink
Adding alias to custom udf (#12219)
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondop committed Aug 29, 2024
1 parent 0f16849 commit 650dfdc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion datafusion/proto/tests/cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ struct MyRegexUdf {
signature: Signature,
// regex as original string
pattern: String,
aliases: Vec<String>,
}

impl MyRegexUdf {
fn new(pattern: String) -> Self {
let signature = Signature::exact(vec![DataType::Utf8], Volatility::Immutable);
Self { signature, pattern }
Self {
signature,
pattern,
aliases: vec!["aggregate_udf_alias".to_string()],
}
}
}

Expand Down Expand Up @@ -67,6 +72,9 @@ impl ScalarUDFImpl for MyRegexUdf {
) -> datafusion_common::Result<ColumnarValue> {
unimplemented!()
}
fn aliases(&self) -> &[String] {
&self.aliases
}
}

#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down

0 comments on commit 650dfdc

Please sign in to comment.