Closed waynexia closed 1 week ago
Attention: Patch coverage is 56.30631%
with 97 lines
in your changes missing coverage. Please review.
Project coverage is 84.87%. Comparing base (
1a9314a
) to head (6779ea2
). Report is 1 commits behind head on main.
The recent changes enhance error handling and control flow in SQL-related functions, primarily involving unary operators. These improvements introduce specific error types for unary operations, modify function signatures for greater flexibility, and update existing logic to support unary operator handling. The goal is to address partition rule expressions and other scenarios where unary operations are involved.
File | Change Summary |
---|---|
src/sql/src/statements.rs |
Enhanced sql_value_to_value function for unary operations; added new error types. |
src/operator/src/req_convert/…/stmt_to_region.rs |
Modified sql_value_to_grpc_value call to include None argument. |
src/sql/src/error.rs |
Added new error variants for unary operators and updated error handling. |
src/sql/src/parsers/create_parser.rs |
Added handling of Expr::UnaryOp in ensure_one_expr function. |
sequenceDiagram
participant User
participant Function
participant ErrorHandler
User->>Function: Call sql_value_to_value with unary_op
Function->>+Logic: Process value with unary_op
Logic-)Function: Return result or error
Function->>+ErrorHandler: Handle InvalidUnaryOp or UnsupportedUnaryOp
ErrorHandler->>User: Return detailed error message
Objective | Addressed | Explanation |
---|---|---|
Handle unary operators in SQL error management (#4247) | ✅ | |
Ensure sql_value_to_value properly processes unary operation expressions (#4247) |
✅ | |
Modify function signature to accommodate additional unary operation parameter (#4247) | ✅ | |
Recursive handling of unary operations for expression parsing in create_parser (#4247) | ✅ |
In code we trust, our logic aligned,
Unary operations no longer confined.
Errors will falter, precise and clear,
With each new function, it’s innovation we steer. 🐰✨
Through SQL pathways, our solutions now shine,
GreptimeDB's strength, a testament in time.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@waynexia After rebasing, there is a compile error that needs to be fixed.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
Closes #4247
What's changed and what's your intention?
Make the unary operator an optional parameter of
sql_value_to_value
and handle it in several places stated in title.Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Refactor