adriangb commented on code in PR #19538:
URL: https://github.com/apache/datafusion/pull/19538#discussion_r2721539140
##########
datafusion/expr/src/expr.rs:
##########
@@ -1933,6 +1933,32 @@ impl Expr {
}
}
+ /// Returns the triviality classification of this expression.
+ ///
+ /// Trivial expressions include column references, literals, and nested
+ /// field access via `get_field`.
+ ///
+ /// # Example
+ /// ```
+ /// # use datafusion_expr::{col, ArgTriviality};
+ /// let expr = col("foo");
+ /// assert_eq!(expr.triviality(), ArgTriviality::Column);
+ /// ```
+ pub fn triviality(&self) -> ArgTriviality {
+ match self {
+ Expr::Column(_) => ArgTriviality::Column,
Review Comment:
Same reasoning as
https://github.com/apache/datafusion/pull/19538#discussion_r2721536334
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]