seddonm1 commented on a change in pull request #9654:
URL: https://github.com/apache/arrow/pull/9654#discussion_r589813533



##########
File path: rust/datafusion/src/physical_plan/functions.rs
##########
@@ -494,6 +532,27 @@ pub fn return_type(
                 ));
             }
         }),
+        BuiltinScalarFunction::SplitPart => Ok(match arg_types[0] {
+            DataType::LargeUtf8 => DataType::LargeUtf8,
+            DataType::Utf8 => DataType::Utf8,
+            _ => {
+                // this error is internal as `data_types` should have captured 
this.
+                return Err(DataFusionError::Internal(
+                    "The split_part function can only accept 
strings.".to_string(),
+                ));
+            }
+        }),
+        BuiltinScalarFunction::StartsWith => Ok(DataType::Boolean),

Review comment:
       Because this is just the return type and will always be Boolean whereas 
something like `InitCap` will return either `Utf8`  or `LargeUtf8` depending on 
input 😁 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to