dharanad commented on code in PR #11787:
URL: https://github.com/apache/datafusion/pull/11787#discussion_r1702187735


##########
datafusion/functions/src/string/starts_with.rs:
##########
@@ -29,14 +29,37 @@ use datafusion_expr::{ScalarUDFImpl, Signature, Volatility};
 use crate::utils::make_scalar_function;
 
 /// Returns true if string starts with prefix.
-/// starts_with('alphabet', 'alph') = 't'
+/// starts_with('alphabet', 'alph') = t
 pub fn starts_with<T: OffsetSizeTrait>(args: &[ArrayRef]) -> Result<ArrayRef> {
-    let left = as_generic_string_array::<T>(&args[0])?;
-    let right = as_generic_string_array::<T>(&args[1])?;
+    let bool_result = match (args[0].data_type(), args[1].data_type()) {
+        (DataType::Utf8View, DataType::Utf8View) => {

Review Comment:
   This is super cool.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to