rluvaton commented on code in PR #27471:
URL: https://github.com/apache/datafusion/pull/27471#discussion_r4590463486


##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -44,13 +44,28 @@ use kernels::{
 };
 
 /// Binary expression
-#[derive(Debug, Clone, Eq)]
+#[derive(Clone, Eq)]
 pub struct BinaryExpr {
     left: Arc<dyn PhysicalExpr>,
     op: Operator,
     right: Arc<dyn PhysicalExpr>,
     /// Specifies whether an error is returned on overflow or not
     fail_on_overflow: bool,
+    /// Whether `right` is volatile, computed once in [`BinaryExpr::new`] for
+    /// `OR` so it is not walked for every batch. `None` for other operators.
+    right_volatility: Option<bool>,

Review Comment:
   not having cache will force to be evaluated on every batch if this is taken 
a lot
   and having a cache but making it `bool` will be wrong since it will say 
right is not volatile for non `OR`.
   
   having it as an option will make sure that it is not trusted blindly  



-- 
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]

Reply via email to