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


##########
datafusion/core/tests/sqllogictests/test_files/array.slt:
##########
@@ -389,6 +406,115 @@ select array_concat(make_array(10, 20), make_array([30, 
40]), make_array([[50, 6
 ----
 [[[10, 20]], [[30, 40]], [[50, 60]]]
 
+# array_concat column-wise #1
+query ?
+select array_concat(column1, make_array(0)) from arrays_values_without_nulls;
+----
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0]
+[11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0]
+[21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 0]
+[31, 32, 33, 34, 35, 26, 37, 38, 39, 40, 0]
+
+# array_concat column-wise #2
+query ?
+select array_concat(column1, column1) from arrays_values_without_nulls;
+----
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+[11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
20]
+[21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 21, 22, 23, 24, 25, 26, 27, 28, 29, 
30]
+[31, 32, 33, 34, 35, 26, 37, 38, 39, 40, 31, 32, 33, 34, 35, 26, 37, 38, 39, 
40]
+
+# array_concat column-wise #3
+query ?
+select array_concat(make_array(column2), make_array(column3)) from 
arrays_values_without_nulls;
+----
+[1, 1]
+[12, 2]
+[23, 3]
+[34, 4]
+
+# array_concat column-wise #4
+# TODO: concat with null should be empty not 0, this only fails when rhs is 
null.
+# query ?
+# select array_concat(column1, column2) from arrays_values;
+# ----
+# [, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1]
+# [11, 12, 13, 14, 15, 16, 17, 18, , 20, 12]
+# [21, 22, 23, , 25, 26, 27, 28, 29, 30, 23]
+# [31, 32, 33, 34, 35, , 37, 38, 39, 40, 34]
+# [44]
+# [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 0]
+# [51, 52, , 54, 55, 56, 57, 58, 59, 60, 55]
+# [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 66]
+#
+# query ?I
+# select column1, column2 from arrays_values;
+# ----
+# [, 2, 3, 4, 5, 6, 7, 8, 9, 10] 1
+# [11, 12, 13, 14, 15, 16, 17, 18, , 20] 12
+# [21, 22, 23, , 25, 26, 27, 28, 29, 30] 23
+# [31, 32, 33, 34, 35, , 37, 38, 39, 40] 34
+# NULL 44
+# [41, 42, 43, 44, 45, 46, 47, 48, 49, 50] NULL
+# [51, 52, , 54, 55, 56, 57, 58, 59, 60] 55
+# [61, 62, 63, 64, 65, 66, 67, 68, 69, 70] 66
+
+# TODO: NULL should be empty not 0
+# query ?
+# select array_concat(make_array(column2), make_array(0)) from arrays_values;
+# ----
+# [1, 0]
+# [12, 0]
+# [23, 0]
+# [34, 0]
+# [44, 0]
+# [0, 0]

Review Comment:
   This is solved by https://github.com/apache/arrow-datafusion/pull/6900!



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