aryan-212 commented on code in PR #19984:
URL: https://github.com/apache/datafusion/pull/19984#discussion_r2725610650
##########
datafusion/spark/src/function/string/concat.rs:
##########
@@ -89,10 +93,21 @@ impl ScalarUDFImpl for SparkConcat {
)
}
fn return_field_from_args(&self, args: ReturnFieldArgs<'_>) ->
Result<FieldRef> {
+ use DataType::*;
+
// Spark semantics: concat returns NULL if ANY input is NULL
let nullable = args.arg_fields.iter().any(|f| f.is_nullable());
- Ok(Arc::new(Field::new("concat", DataType::Utf8, nullable)))
+ // Determine return type: Utf8View > LargeUtf8 > Utf8
+ let mut dt = &Utf8;
+ for field in args.arg_fields {
Review Comment:
what if I keep the `TypeSignature` as `UserDefined` only?
--
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]