findepi commented on code in PR #17351:
URL: https://github.com/apache/datafusion/pull/17351#discussion_r2324681354


##########
datafusion/physical-expr-common/src/physical_expr.rs:
##########
@@ -377,6 +377,19 @@ pub trait PhysicalExpr: Any + Send + Sync + Display + 
Debug + DynEq + DynHash {
         // static expressions will always return 0.
         0
     }
+
+    /// Returns true if the expression node is volatile, i.e. whether it can 
return
+    /// different results when evaluated multiple times with the same input.
+    ///
+    /// Note: unlike [`is_volatile`], this function does not consider inputs:
+    /// - `random()` returns `true`,
+    /// - `a + random()` returns `false`
+    ///
+    /// By default, expressions are not volatile to avoid imposing API churn 
on implementers.
+    /// It is highly recommended that volatile expressions implement this 
method and return `true`.
+    fn is_volatile_node(&self) -> bool {
+        false

Review Comment:
   > My thought was that we've lived with a world where if you have a custom 
volatile expression you can't teach DataFusion about it for a long time now.
   
   good point
   
   let's leave it as is



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to