save-buffer commented on a change in pull request #11579:
URL: https://github.com/apache/arrow/pull/11579#discussion_r744073752
##########
File path: cpp/src/arrow/compute/exec/expression.h
##########
@@ -91,6 +91,9 @@ class ARROW_EXPORT Expression {
/// Return true if this expression could evaluate to true.
bool IsSatisfiable() const;
+ /// Return true if this expression has no clauses.
+ bool IsEmpty() const;
Review comment:
Thinking about it more, I'm not a big fan of this `literal(true)`
convention. Currently, null expressions are allowed (by calling the default
constructor). It's very bug-prone leaving code around that assumes expressions
are non-null while having no good way of checking this. Maybe instead of
introducing `IsEmpty` you can do `== Expression()`, but at that point I feel
`IsEmpty` is cleaner.
But anyway, If this is the convention, then the default constructor should
be deleted to eliminate the possibility of there ever being a null
`Expression`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]