-
Notifications
You must be signed in to change notification settings - Fork 590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(expr): support implicit cast of arguments for table and aggregate functions #13545
Conversation
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
545b566
to
23c0cab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really great to see AggCall::infer_return_type
being removed!
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
f59ec07
to
248a582
Compare
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM!
/// A function to build the aggregate function (append-only version). | ||
pub build_aggregate_append_only: Option<AggregateFunctionBuilder>, | ||
/// A function to build the expression. | ||
pub build: FuncBuilder, | ||
|
||
/// A function to infer the return type from argument types. | ||
pub type_infer: fn(args: &[DataType]) -> Result<DataType>, | ||
|
||
/// Whether the function is deprecated and should not be used in the frontend. | ||
/// For backward compatibility, it is still available in the backend. | ||
pub deprecated: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to have another field representing internal
? Since internal functions may also be deprecated. Not a strong opinion though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal
is just an alias of deprecated
. They are the same from the view of signature. 🤔
Signed-off-by: Runji Wang <[email protected]>
Signed-off-by: Runji Wang <[email protected]>
b8b8a25
to
b55ff3d
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #13545 +/- ##
==========================================
- Coverage 68.31% 68.26% -0.06%
==========================================
Files 1523 1523
Lines 261730 261805 +75
==========================================
- Hits 178794 178714 -80
- Misses 82936 83091 +155
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR resolves #13205. Table functions and aggregate functions now support implicit cast.
To achieve that, the
infer_type
method is reused for table functions and aggregate functions.Next, to handle special cases in
AggCall::infer_return_type
, this PR defines these functions inexpr_impl
crate, with a newly introducedunimplemented
tag. Functions defined like this are visible in the signature map, but can not be built in the backend.This PR also merges retractable and append-only aggregate into one signature. Otherwise,
infer_type
might find 2 functions even if there is only one:Similarly, the internal
sum(int8) -> int8
is marked as deprecated to prevent not unique error.Checklist
./risedev check
(or alias,./risedev c
)Documentation