-
Notifications
You must be signed in to change notification settings - Fork 1.7k
ScalarFunctionExpr Maintaining Order #7417
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
ScalarFunctionExpr Maintaining Order #7417
Conversation
… their preservation of order
Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
…m/synnada-ai/arrow-datafusion into feature/scalar-func-expr-ordering
|
I believe CI will pass after merging up from |
|
@alamb I have synced the branch. If no objection, the PR is ready to merge. |
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.
LGTM, any feedback @alamb?
|
There doesn't seem to be any concerns about this, so I will go ahead with merging. Should there be any issues, we will address via quick follow-on PRs. |
Sorry I was on vacation -- thanks for merging it and moving things along! |
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.
Looks good to me -- thanks @berkaysynnada
Which issue does this PR close?
Closes #.
Rationale for this change
After
ProjectionExecis able to propagate the orders of non-column expressions, it is also possible to preserve the order of someScalarFunctionExpr's. This PR implements that feature.This PR is the 3rd step of #7296 and #7364 PR's. Now, we have the support of propagating the sort order over different kinds of
PhysicalExpr's at the projection stage.What changes are included in this PR?
While creating
ScalarFunctionExpr, we check its order preservation info fromBuiltinScalarFunction.math_expressionsanddatetime_expressionsare labeled according to their functional monotonicity.ScalarFunctionExprnow has a fieldmonotonicity: Option<FuncMonotonicity>.FuncMonotonicitykeeps monotonicity information of the function. It is one to one mapped toargsof the function, and it specifies the effect of an increase or decrease in the correspondingargto the function value.Are these changes tested?
Yes, by .slt tests with some of the functions.
Are there any user-facing changes?