pjmore commented on a change in pull request #1066:
URL: https://github.com/apache/arrow-datafusion/pull/1066#discussion_r720512539



##########
File path: datafusion/src/physical_plan/functions.rs
##########
@@ -543,6 +553,28 @@ macro_rules! invoke_if_unicode_expressions_feature_flag {
     };
 }
 
+///Function volatility determines when a function can be inlined or in the 
future have evaluations elided when the arguments are the same
+///Immutable - a pure function which always remains the same
+///Stable - Maybe not required?. Used for functions which can modify the db 
but are stable for multiple calls in statement
+///Volatile - Functions where output can vary for each call.
+///For more information see 
https://www.postgresql.org/docs/current/xfunc-volatility.html
+#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
+#[repr(u32)]
+pub enum FunctionVolatility {
+    ///Immutable - a pure function which always remains the same
+    Immutable = 0,
+    ///Stable - Maybe not required?. Used for functions which can modify the 
db but are stable for multiple calls in statement is this relevant for 
datafusion as in mem?
+    Stable = 1,
+    ///Volatile - Functions where output can vary for each call.
+    Volatile = 2,
+}
+
+impl Default for FunctionVolatility {

Review comment:
       That makes a lot of sense. I'll remove the default volatility.




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


Reply via email to