comphead commented on code in PR #20770:
URL: https://github.com/apache/datafusion/pull/20770#discussion_r2942198458
##########
datafusion/functions-nested/src/position.rs:
##########
@@ -185,14 +140,64 @@ impl ScalarUDFImpl for ArrayPosition {
}
}
+/// Attempts the scalar-needle fast path for `array_position`.
+fn try_array_position_scalar(args: &[ColumnarValue]) ->
Result<Option<ColumnarValue>> {
+ if args.len() < 2 || args.len() > 3 {
+ return exec_err!("array_position expects two or three arguments");
+ }
+
+ let scalar_needle = match &args[1] {
+ ColumnarValue::Scalar(s) => s,
+ ColumnarValue::Array(_) => return Ok(None),
Review Comment:
maybe we can also comment why we fallback for arrays
--
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]