-
Notifications
You must be signed in to change notification settings - Fork 70
feat: add or expression #120
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
Conversation
yingcai-cy
commented
Jun 10, 2025
- or expression
- change negate return type form Result to Expression
- add some tests
- or expression - change negate return type form Result to Expression - add some tests
| virtual Result<std::shared_ptr<Expression>> Negate() const { | ||
| return InvalidExpression("Expression cannot be negated"); | ||
| virtual std::shared_ptr<Expression> Negate() const { | ||
| throw IcebergError("Expression cannot be negated"); |
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.
Why changing the return type? We need to stick to Result instead of exception.
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 been a couple of days, let me recall. I believe the reason is that all expression implementations have a corresponding Negate form, so none of them would return incorrect results in this context.
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.
Everything can be negated in theory, and this is also the case in practice.
| virtual Result<std::shared_ptr<Expression>> Negate() const { | ||
| return InvalidExpression("Expression cannot be negated"); | ||
| virtual std::shared_ptr<Expression> Negate() const { | ||
| throw IcebergError("Expression cannot be negated"); |
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.
Everything can be negated in theory, and this is also the case in practice.
wgtmac
left a comment
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.
+1
|
Thanks @yingcai-cy for working on this, and @wgtmac for the review 🚀 |
- or expression - change negate return type form Result to Expression - add some tests