alamb commented on code in PR #17264:
URL: https://github.com/apache/datafusion/pull/17264#discussion_r2292196513


##########
datafusion/expr-common/src/signature.rs:
##########
@@ -44,42 +43,79 @@ pub const TIMEZONE_WILDCARD: &str = "+TZ";
 /// valid length. It exists to avoid the need to enumerate all possible fixed 
size list lengths.
 pub const FIXED_SIZE_LIST_WILDCARD: i32 = i32::MIN;
 
-/// A function's volatility, which defines the functions eligibility for 
certain optimizations
+/// When a function's output changes when the input does not
+///
+/// The volatility of a function determine eligibility for certain
+/// optimizations. You should always defined your function to have the 
strictest
+/// volatility that applies to it to maximize performance and avoid unexpected
+/// results.
+///
 #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
 pub enum Volatility {
-    /// An immutable function will always return the same output when given 
the same
-    /// input. DataFusion will attempt to inline immutable functions during 
planning.
+    /// Always returns the same output when given the same input.
+    ///
+    /// DataFusion will inline immutable functions during planning.
     Immutable,
-    /// A stable function may return different values given the same input 
across different
-    /// queries but must return the same value for a given input within a 
query. An example of
-    /// this is the `Now` function. DataFusion will attempt to inline `Stable` 
functions
-    /// during planning, when possible.
-    /// For query `select col1, now() from t1`, it might take a while to 
execute but
-    /// `now()` column will be the same for each output row, which is evaluated
-    /// during planning.
+    /// May return different values given the same input across different
+    /// queries but must return the same value for a given input within a 
query.
+    ///
+    /// An example of a stable function is the `now()` function. For example,
+    /// the query `select col1, now() from t1`, will return different results
+    /// each time it is run, but within the same query, the output of the
+    /// `now()` function has the same value for each output row.
+    ///
+    /// DataFusion will inline `Stable` functions during planning, when

Review Comment:
   For example, `Stable` functions are inlined when planning a query for 
execution, but not in View definitions or prepared statements. But `Immutable` 
functions are always inlined when possible
   
   I have tried to clarify as well



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