Skip to content

Commit 650dfdc

Browse files
authored
Adding alias to custom udf (#12219)
1 parent 0f16849 commit 650dfdc

File tree

1 file changed

+9
-1
lines changed
  • datafusion/proto/tests/cases

1 file changed

+9
-1
lines changed

datafusion/proto/tests/cases/mod.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ struct MyRegexUdf {
3434
signature: Signature,
3535
// regex as original string
3636
pattern: String,
37+
aliases: Vec<String>,
3738
}
3839

3940
impl MyRegexUdf {
4041
fn new(pattern: String) -> Self {
4142
let signature = Signature::exact(vec![DataType::Utf8], Volatility::Immutable);
42-
Self { signature, pattern }
43+
Self {
44+
signature,
45+
pattern,
46+
aliases: vec!["aggregate_udf_alias".to_string()],
47+
}
4348
}
4449
}
4550

@@ -67,6 +72,9 @@ impl ScalarUDFImpl for MyRegexUdf {
6772
) -> datafusion_common::Result<ColumnarValue> {
6873
unimplemented!()
6974
}
75+
fn aliases(&self) -> &[String] {
76+
&self.aliases
77+
}
7078
}
7179

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

0 commit comments

Comments
 (0)