jayzhan211 commented on code in PR #9233:
URL: https://github.com/apache/arrow-datafusion/pull/9233#discussion_r1492342440


##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -130,6 +130,31 @@ fn get_valid_types(
             _ => Ok(vec![vec![]]),
         }
     }
+    fn array_append_and_optional_index(
+        current_types: &[DataType],
+    ) -> Result<Vec<Vec<DataType>>> {
+        // make sure there's at least 2 arguments
+        if !(current_types.len() == 2 || current_types.len() == 3) {
+            return Ok(vec![vec![]]);
+        }
+
+        let first_two_types = &current_types[0..2];
+        let valid_types = array_append_or_prepend_valid_types(first_two_types, 
true)?;
+
+        let valid_types_with_index = valid_types

Review Comment:
   I think we can optionally append valid_types_with_index if the length is 3, 
otherwise, return here.



##########
datafusion/expr/src/type_coercion/functions.rs:
##########
@@ -130,6 +130,31 @@ fn get_valid_types(
             _ => Ok(vec![vec![]]),
         }
     }
+    fn array_append_and_optional_index(
+        current_types: &[DataType],
+    ) -> Result<Vec<Vec<DataType>>> {
+        // make sure there's at least 2 arguments
+        if !(current_types.len() == 2 || current_types.len() == 3) {
+            return Ok(vec![vec![]]);
+        }
+
+        let first_two_types = &current_types[0..2];
+        let valid_types = array_append_or_prepend_valid_types(first_two_types, 
true)?;
+
+        let valid_types_with_index = valid_types

Review Comment:
   We can optionally append valid_types_with_index if the length is 3, 
otherwise, return here.



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

Reply via email to