-
Notifications
You must be signed in to change notification settings - Fork 600
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: add overlay string function #3671
Conversation
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.
Has communicated in private about how to fix the SqlSmith tests error
In short, we generate an Expr::Overlay
instead of a Function
in SqlSmith, so that when overlay
is formatted in the SQL, it will properly use the form of overlay(string placing string from int [for int])
instead of overlay(string, string, int[, int])
.
Codecov Report
@@ Coverage Diff @@
## main #3671 +/- ##
==========================================
+ Coverage 74.25% 74.29% +0.03%
==========================================
Files 789 791 +2
Lines 111351 111592 +241
==========================================
+ Hits 82687 82909 +222
- Misses 28664 28683 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
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!
* Added (empty) file for overlay function. * Added empty overlay function. * Added test function. * Added second function to avoid optional parameter. * Made functions public. * Added overlay reference to 'expr_ternary_bytes.rs'. * Added test for new_overlay_exp. * Added overlay reference in 'build_expr_from_prost.rs'. * Added Overlay as type of ExprNode. * Added overlay to parser. * Added test for overlay to parser. * Removed redundant parentheses in if-statement. * Added overlay to binder. * Properly embedded overlay with 4 + 1 arguments. * Some minor formating fixes. * Added e2e tests. * Removed obsolete ToDo comment. * Fixed sqlsmith code to generat proper code for overlay functions. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.
What's changed and what's your intention?
The changes allow to use the overlay function in SQL queries.
It adds according code to the sql-parser, binder, and the logic for that function.
The logic of
Checklist
I have written necessary rustdoc comments
There are no such comments since existing similar functions also do not use them.
I have added necessary unit tests and integration tests
e2e_tests/batch/functions/overlay.slt.part
)tests: strings
) which contains tests for overlay. For it, the results match the expected output.All checks passed in
./risedev check
(or alias,./risedev c
)Documentation
Types of user-facing changes
Release note
SQL queries now support the overlay function.
Refer to a related PR or issue link (optional)
#112
#665