EeshanBembi commented on code in PR #18137:
URL: https://github.com/apache/datafusion/pull/18137#discussion_r2658922643


##########
datafusion/sqllogictest/test_files/spark/string/concat.slt:
##########
@@ -46,3 +46,39 @@ SELECT concat(a, b, c) from (select 'a' a, 'b' b, 'c' c 
union all select null a,
 ----
 abc
 NULL
+
+# Test array concatenation
+query ?
+SELECT concat([1, 2], [3, 4]);
+----
+[1, 2, 3, 4]
+
+query ?
+SELECT concat([1, 2], [3, 4], [5, 6]);
+----
+[1, 2, 3, 4, 5, 6]
+
+# Test array concatenation with nulls - Spark returns NULL if any argument is 
NULL
+query ?
+SELECT concat([1, 2], NULL, [3, 4]);
+----
+NULL
+
+# Test array concatenation with empty arrays - Arrow limitation with Null vs 
Int64 types
+statement error Arrow error: Invalid argument error: It is not possible to 
concatenate arrays of different data types
+SELECT concat([], [1, 2]);
+
+statement error Arrow error: Invalid argument error: It is not possible to 
concatenate arrays of different data types  
+SELECT concat([1, 2], []);

Review Comment:
   Agreed! I'll create a follow-up issue to track this separately rather than 
expanding the scope 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to