izveigor commented on code in PR #7057:
URL: https://github.com/apache/arrow-datafusion/pull/7057#discussion_r1274119583


##########
datafusion/core/tests/sqllogictests/test_files/array.slt:
##########
@@ -907,14 +907,122 @@ select array_positions(column1, make_array(4, 5, 6)), 
array_positions(make_array
 [6] []
 [1] []
 
-## array_replace
+## array_replace (replaces one occurrence of an element) (aliases: 
`list_replace`)
 
-# array_replace scalar function
+# array_replace scalar function #1
 query ???
 select array_replace(make_array(1, 2, 3, 4), 2, 3), 
array_replace(make_array(1, 4, 4, 5, 4, 6, 7), 4, 0), 
array_replace(make_array(1, 2, 3), 4, 0);
 ----
+[1, 3, 3, 4] [1, 0, 4, 5, 4, 6, 7] [1, 2, 3]
+
+# array_replace scalar function #2 (with optional argument)
+query ???
+select array_replace(make_array(1, 2, 3, 4), 2, 3, 2), 
array_replace(make_array(1, 4, 4, 5, 4, 6, 7), 4, 0, 2), 
array_replace(make_array(1, 2, 3), 4, 0, 3);

Review Comment:
   Yes, I agree. Thanks for the great idea, @alamb!



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