erenavsarogullari commented on code in PR #20420:
URL: https://github.com/apache/datafusion/pull/20420#discussion_r2825539887
##########
datafusion/sqllogictest/test_files/spark/array/shuffle.slt:
##########
@@ -87,9 +87,36 @@ SELECT shuffle(column1, 1) FROM test_shuffle_fixed_size;
[9, NULL, 8]
NULL
-# Clean up
-statement ok
-DROP TABLE test_shuffle_list_types;
+query ?
+SELECT shuffle(['2001-09-28T01:00:00'::timestamp,
'2001-08-28T01:00:00'::timestamp, '2001-07-28T01:00:00'::timestamp,
'2001-06-28T01:00:00'::timestamp, '2001-05-28T01:00:00'::timestamp], 1);
+----
+[2001-09-28T01:00:00, 2001-06-28T01:00:00, 2001-07-28T01:00:00,
2001-08-28T01:00:00, 2001-05-28T01:00:00]
-statement ok
-DROP TABLE test_shuffle_fixed_size;
+query ?
+SELECT shuffle(shuffle([1, 20, NULL, 3, 100, NULL, 98, 99], 1), 1);
+----
+[1, 99, NULL, 98, 100, NULL, 3, 20]
+
+query ?
+SELECT shuffle([' ', NULL, 'abc'], 1);
+----
+[ , NULL, abc]
+
+query ?
+SELECT shuffle([1, 2, 3, 4], CAST('2' AS INT));
+----
+[1, 4, 2, 3]
+
+
+query error
+SELECT shuffle([2, 1, 'abc'], 1);
+----
+DataFusion error: Optimizer rule 'simplify_expressions' failed
+caused by
+Arrow error: Cast error: Cannot cast string 'abc' to value of Int64 type
+
+
+query error
+SELECT shuffle([2, 1], NULL);
+----
+DataFusion error: Execution error: shuffle seed must be Int64 type, got 'Int64'
Review Comment:
Reverted negative cases for now.
--
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]