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


##########
datafusion/functions/src/datetime/now.rs:
##########
@@ -54,6 +57,15 @@ impl NowFunc {
         Self {
             signature: Signature::nullary(Volatility::Stable),
             aliases: vec!["current_timestamp".to_string()],
+            timezone: Some(Arc::from("+00")),

Review Comment:
   Update: Yes, this is the implication
   
   



##########
datafusion/expr/src/udf.rs:
##########
@@ -532,6 +532,25 @@ pub trait ScalarUDFImpl: Debug + DynEq + DynHash + Send + 
Sync {
     /// [`DataFusionError::Internal`]: 
datafusion_common::DataFusionError::Internal
     fn return_type(&self, arg_types: &[DataType]) -> Result<DataType>;
 
+    /// Create a new instance of this function with updated configuration.
+    ///
+    /// This method is called when configuration options change at runtime
+    /// (e.g., via `SET` statements) to allow functions that depend on
+    /// configuration to update themselves accordingly.

Review Comment:
   I think it would be useful to document one of the usecases, namely that it 
should be used when the type of the expression depends on the configuration 
values. 
   
   For example, something like this:
   
   ```suggestion
       /// This method is called when configuration options change at runtime
       /// (e.g., via `SET` statements) to allow functions that depend on
       /// configuration to update themselves accordingly. 
       ///
       /// Note the current [`ConfigOptions`] are also passed to 
[`Self::invoke_with_args`] so
       /// this API is not needed for functions where the values may
       /// depend on the current options. 
       ///
       /// This API is useful for functions where the return
       /// **type** depends on the configuration options, such as the `now()` 
function
       /// which depends on the current timezone. 
   ```



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