-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework validation of names and aliases for aggregate UDFs
Add better validation that `name = ...` and `alias = ...` line up when there is a mismatch between the `BasicUdf` and `AggregateUdf` implementation, and fix a problem that was disallowing use of aliases in aggregate UDFs. Error messages are significantly improved. Fixes <#59>
- Loading branch information
Showing
11 changed files
with
527 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#![allow(unused)] | ||
|
||
use udf::prelude::*; | ||
|
||
struct MyUdf; | ||
|
||
impl AggregateUdf for MyUdf { | ||
// Required methods | ||
fn clear(&mut self, cfg: &UdfCfg<Process>, error: Option<NonZeroU8>) -> Result<(), NonZeroU8> { | ||
todo!() | ||
} | ||
fn add( | ||
&mut self, | ||
cfg: &UdfCfg<Process>, | ||
args: &ArgList<'_, Process>, | ||
error: Option<NonZeroU8>, | ||
) -> Result<(), NonZeroU8> { | ||
todo!() | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0277]: the trait bound `MyUdf: BasicUdf` is not satisfied | ||
--> tests/fail/agg_missing_basic.rs:7:23 | ||
| | ||
7 | impl AggregateUdf for MyUdf { | ||
| ^^^^^ the trait `BasicUdf` is not implemented for `MyUdf` | ||
| | ||
note: required by a bound in `udf::AggregateUdf` | ||
--> $WORKSPACE/udf/src/traits.rs | ||
| | ||
| pub trait AggregateUdf: BasicUdf { | ||
| ^^^^^^^^ required by this bound in `AggregateUdf` |
Oops, something went wrong.