xonx4l commented on code in PR #19675:
URL: https://github.com/apache/datafusion/pull/19675#discussion_r2789771470


##########
datafusion/functions/src/datetime/now.rs:
##########
@@ -112,26 +111,11 @@ impl ScalarUDFImpl for NowFunc {
         internal_err!("return_field_from_args should be called instead")
     }
 
-    fn invoke_with_args(
-        &self,
-        _args: datafusion_expr::ScalarFunctionArgs,
-    ) -> Result<ColumnarValue> {
-        internal_err!("invoke should not be called on a simplified now() 
function")
-    }
-
-    fn simplify(
-        &self,
-        _args: Vec<Expr>,
-        info: &dyn SimplifyInfo,
-    ) -> Result<ExprSimplifyResult> {
-        let now_ts = info
-            .execution_props()
-            .query_execution_start_time
-            .timestamp_nanos_opt();
-
-        Ok(ExprSimplifyResult::Simplified(Expr::Literal(
-            ScalarValue::TimestampNanosecond(now_ts, self.timezone.clone()),
-            None,
+    fn invoke_with_args(&self, _args: ScalarFunctionArgs) -> 
Result<ColumnarValue> {
+        let now = chrono::Utc::now();

Review Comment:
   I mean I will revert the changes to now.rs and keep its custom simplify 
logic and  will modify the helper to try the UDF's simplify method first. where 
If it returns a result (like for now()) we use it and If not we fall back to 
the new execution logic.



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