kumarUjjawal commented on code in PR #19236:
URL: https://github.com/apache/datafusion/pull/19236#discussion_r2607299415


##########
datafusion/spark/src/function/datetime/make_dt_interval.rs:
##########
@@ -99,7 +101,16 @@ impl ScalarUDFImpl for SparkMakeDtInterval {
     ///
     /// [Sail compatibility doc]: 
https://github.com/lakehq/sail/blob/dc5368daa24d40a7758a299e1ba8fc985cb29108/docs/guide/dataframe/data-types/compatibility.md?plain=1#L260
     fn return_type(&self, _arg_types: &[DataType]) -> Result<DataType> {
-        Ok(DataType::Duration(Microsecond))
+        internal_err!("return_field_from_args should be used instead")
+    }
+
+    fn return_field_from_args(&self, args: ReturnFieldArgs) -> 
Result<FieldRef> {
+        let nullable = args.arg_fields.iter().any(|f| f.is_nullable());

Review Comment:
   Updated  so if any input is nullable or `secs` is a non‑finite literal , the 
output is marked nullable, otherwise it stays non‑nullable. 



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