Jefffrey commented on code in PR #19911:
URL: https://github.com/apache/datafusion/pull/19911#discussion_r2713019506


##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -223,13 +224,12 @@ impl ScalarUDFImpl for DateTruncFunc {
         &self.signature
     }
 
-    // keep return_type implementation for information schema generation
-    fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
-        if arg_types[1].is_null() {

Review Comment:
   Again, this comment was resolved without any action taken.



##########
datafusion/functions/src/datetime/date_trunc.rs:
##########
@@ -14,6 +14,7 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+use datafusion_common::internal_err;

Review Comment:
   Move this import down, it's causing the license CI check to fail



##########
datafusion/catalog/src/information_schema.rs:
##########
@@ -421,10 +421,22 @@ fn get_udf_args_and_return_types(
         Ok(arg_types
             .into_iter()
             .map(|arg_types| {
-                // only handle the function which implemented 
[`ScalarUDFImpl::return_type`] method
+                // prefer the newer `return_field_from_args` API which allows
+                // nullability and value-based return type decisions. Build
+                // the expected `ReturnFieldArgs` from the example arg types
+                // and pass `None` for scalar arguments since we don't have
+                // concrete scalar values here.

Review Comment:
   Please refrain from resolving a conversation if no action has been taken nor 
any comment left to explain why action was not taken.



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